2017-12-13 10:49:32 +01:00
|
|
|
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
2020-12-01 15:31:26 -03:00
|
|
|
import I18n from "I18n";
|
2020-02-03 14:22:14 +01:00
|
|
|
|
2017-12-13 10:49:32 +01:00
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
|
|
pluginApiIdentifiers: ["toolbar-popup-menu-options"],
|
|
|
|
classNames: ["toolbar-popup-menu-options"],
|
|
|
|
|
2020-02-03 14:22:14 +01:00
|
|
|
selectKitOptions: {
|
|
|
|
showFullTitle: false,
|
|
|
|
filterable: false,
|
2020-09-04 13:42:47 +02:00
|
|
|
autoFilterable: false,
|
2021-04-16 11:10:02 -04:00
|
|
|
preventHeaderFocus: true,
|
2021-05-20 02:00:45 -04:00
|
|
|
customStyle: true,
|
2020-02-03 14:22:14 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
modifyContent(contents) {
|
|
|
|
return contents
|
2020-09-04 13:42:47 +02:00
|
|
|
.map((content) => {
|
2020-02-03 14:22:14 +01:00
|
|
|
if (content.condition) {
|
2018-06-15 17:03:24 +02:00
|
|
|
return {
|
2020-02-03 14:22:14 +01:00
|
|
|
icon: content.icon,
|
|
|
|
name: I18n.t(content.label),
|
2020-09-04 13:42:47 +02:00
|
|
|
id: content.action,
|
2018-06-15 17:03:24 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
})
|
2020-02-03 14:22:14 +01:00
|
|
|
.filter(Boolean);
|
2020-09-04 13:42:47 +02:00
|
|
|
},
|
2017-12-13 10:49:32 +01:00
|
|
|
});
|