mami/src/mami.js/sidebar/act-collapse-all.jsx

18 lines
588 B
JavaScript

const MamiSidebarActionCollapseAll = function() {
// this should take a reference to the message container rather than just using $qa
return {
get name() { return 'act:collapse-all'; },
get text() { return 'Collapse any expanded elements'; },
createdButton: button => {
button.element.append(<i class="far fa-minus-square sidebar-gutter-font-icon"/>);
},
onclick: () => {
const buttons = $queryAll('[data-embed="1"]');
for(const button of buttons)
button.click();
},
};
};