discourse/app/assets/javascripts/select-kit/components/categories-admin-dropdown.j...

44 lines
977 B
Plaintext
Raw Normal View History

import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
2017-10-19 15:51:08 -04:00
export default DropdownSelectBoxComponent.extend({
pluginApiIdentifiers: ["categories-admin-dropdown"],
2017-10-19 15:51:08 -04:00
classNames: "categories-admin-dropdown",
showFullTitle: false,
allowInitialValueMutation: false,
init() {
this._super(...arguments);
this.headerIcon = ["bars"];
},
2017-10-19 15:51:08 -04:00
autoHighlight() {},
2017-10-19 15:51:08 -04: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;
},
mutateValue(value) {
2017-11-09 13:57:53 -05:00
this.get(value)();
2017-10-19 15:51:08 -04:00
}
});