mirror of
https://github.com/discourse/discourse.git
synced 2024-12-18 21:38:44 +08:00
a532e64389
* DEV: Some select-box headers don't need a class * remove duplicate class
30 lines
717 B
JavaScript
30 lines
717 B
JavaScript
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
|
import I18n from "I18n";
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
|
pluginApiIdentifiers: ["toolbar-popup-menu-options"],
|
|
classNames: ["toolbar-popup-menu-options"],
|
|
|
|
selectKitOptions: {
|
|
showFullTitle: false,
|
|
filterable: false,
|
|
autoFilterable: false,
|
|
preventHeaderFocus: true,
|
|
customStyle: true,
|
|
},
|
|
|
|
modifyContent(contents) {
|
|
return contents
|
|
.map((content) => {
|
|
if (content.condition) {
|
|
return {
|
|
icon: content.icon,
|
|
name: I18n.t(content.label),
|
|
id: content.action,
|
|
};
|
|
}
|
|
})
|
|
.filter(Boolean);
|
|
},
|
|
});
|