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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
985 B
Plaintext
Raw Normal View History

import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { computed } from "@ember/object";
import { setting } from "discourse/lib/computed";
2017-10-19 15:51:08 -04:00
export default DropdownSelectBoxComponent.extend({
pluginApiIdentifiers: ["categories-admin-dropdown"],
classNames: ["categories-admin-dropdown"],
fixedCateoryPositions: setting("fixed_category_positions"),
selectKitOptions: {
icon: "bars",
showFullTitle: false,
autoFilterable: false,
filterable: false
},
2017-10-19 15:51:08 -04:00
content: computed(function() {
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"
}
];
if (this.fixedCateoryPositions) {
2017-10-19 15:51:08 -04:00
items.push({
id: "reorder",
name: I18n.t("categories.reorder.title"),
description: I18n.t("categories.reorder.title_long"),
icon: "random"
});
}
return items;
})
2017-10-19 15:51:08 -04:00
});