2017-12-13 04:49:32 -05:00
|
|
|
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
2020-05-13 16:23:41 -04:00
|
|
|
import I18n from "I18n";
|
2020-02-03 08:22:14 -05:00
|
|
|
|
2017-12-13 04:49:32 -05:00
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
|
|
pluginApiIdentifiers: ["toolbar-popup-menu-options"],
|
|
|
|
classNames: ["toolbar-popup-menu-options"],
|
|
|
|
|
2020-02-03 08:22:14 -05:00
|
|
|
selectKitOptions: {
|
|
|
|
showFullTitle: false,
|
|
|
|
filterable: false,
|
|
|
|
autoFilterable: false,
|
|
|
|
},
|
|
|
|
|
|
|
|
modifyContent(contents) {
|
|
|
|
return contents
|
|
|
|
.map((content) => {
|
|
|
|
if (content.condition) {
|
2017-12-13 04:49:32 -05:00
|
|
|
return {
|
2020-02-03 08:22:14 -05:00
|
|
|
icon: content.icon,
|
|
|
|
name: I18n.t(content.label),
|
|
|
|
id: content.action,
|
2017-12-13 04:49:32 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
})
|
2020-02-03 08:22:14 -05:00
|
|
|
.filter(Boolean);
|
|
|
|
},
|
2017-12-13 04:49:32 -05:00
|
|
|
});
|