2017-11-21 05:53:09 -05:00
|
|
|
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
|
2017-10-19 15:51:08 -04:00
|
|
|
|
|
|
|
export default DropdownSelectBoxComponent.extend({
|
2017-11-21 05:53:09 -05:00
|
|
|
pluginApiIdentifiers: ["categories-admin-dropdown"],
|
2017-10-19 15:51:08 -04:00
|
|
|
classNames: "categories-admin-dropdown",
|
2017-11-21 05:53:09 -05:00
|
|
|
showFullTitle: false,
|
|
|
|
allowInitialValueMutation: false,
|
2018-10-02 15:06:50 -04:00
|
|
|
headerIcon: ["bars"],
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2017-11-21 05:53:09 -05:00
|
|
|
autoHighlight() {},
|
2017-10-19 15:51:08 -04:00
|
|
|
|
2017-11-21 05:53:09 -05:00
|
|
|
computeContent() {
|
2017-10-19 15:51:08 -04:00
|
|
|
const items = [
|
|
|
|
{
|
|
|
|
id: "create",
|
|
|
|
name: I18n.t("category.create"),
|
|
|
|
description: I18n.t("category.create_long"),
|
|
|
|
icon: "plus"
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
const includeReorder = this.get("siteSettings.fixed_category_positions");
|
|
|
|
if (includeReorder) {
|
|
|
|
items.push({
|
|
|
|
id: "reorder",
|
|
|
|
name: I18n.t("categories.reorder.title"),
|
|
|
|
description: I18n.t("categories.reorder.title_long"),
|
|
|
|
icon: "random"
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
return items;
|
|
|
|
},
|
|
|
|
|
2017-11-21 05:53:09 -05:00
|
|
|
mutateValue(value) {
|
2017-11-09 13:57:53 -05:00
|
|
|
this.get(value)();
|
2017-10-19 15:51:08 -04:00
|
|
|
}
|
|
|
|
});
|