discourse/app/assets/javascripts/select-kit/addon/components/toolbar-popup-menu-options.js
Joffrey JAFFEUX 31d1468922
UX: reworks various menus to homogenize them (#9905)
- bookmark modal menu
- topic-footer-mobile-dropdown
- post-admin-menu
- topic-admin-menu
- quick-access menus
- toolbar-popup-menu
2020-05-29 08:05:21 +02:00

28 lines
659 B
JavaScript

import I18n from "I18n";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
export default DropdownSelectBoxComponent.extend({
pluginApiIdentifiers: ["toolbar-popup-menu-options"],
classNames: ["toolbar-popup-menu-options"],
selectKitOptions: {
showFullTitle: false,
filterable: false,
autoFilterable: false
},
modifyContent(contents) {
return contents
.map(content => {
if (content.condition) {
return {
icon: content.icon,
name: I18n.t(content.label),
id: content.action
};
}
})
.filter(Boolean);
}
});