mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
UX: highlight "no subcategories" as active dropdown option (#27478)
This commit is contained in:
parent
63e8c79e2f
commit
e245bf2a18
@ -22,6 +22,7 @@ const MORE_COLLECTION = "MORE_COLLECTION";
|
||||
export default ComboBoxComponent.extend({
|
||||
pluginApiIdentifiers: ["category-drop"],
|
||||
classNames: ["category-drop"],
|
||||
classNameBindings: ["noSubcategories:has-selection"],
|
||||
value: readOnly("category.id"),
|
||||
content: readOnly("categoriesWithShortcuts.[]"),
|
||||
noCategoriesLabel: I18n.t("categories.no_subcategories"),
|
||||
@ -64,6 +65,10 @@ export default ComboBoxComponent.extend({
|
||||
return CategoryRow;
|
||||
},
|
||||
|
||||
noSubcategories: computed("selectKit.options.noSubcategories", function () {
|
||||
return this.selectKit.options.noSubcategories;
|
||||
}),
|
||||
|
||||
displayCategoryDescription: computed(function () {
|
||||
return !(
|
||||
this.get("currentUser.staff") || this.get("currentUser.trust_level") > 0
|
||||
@ -101,8 +106,7 @@ export default ComboBoxComponent.extend({
|
||||
});
|
||||
}
|
||||
|
||||
// If there is a single shortcut, we can have a single "remove filter"
|
||||
// option
|
||||
// If there is a single shortcut, we can have a single "remove filter" option
|
||||
if (shortcuts.length === 1 && shortcuts[0].id === ALL_CATEGORIES_ID) {
|
||||
shortcuts[0].name = I18n.t("categories.remove_filter");
|
||||
}
|
||||
|
@ -21,8 +21,10 @@
|
||||
|
||||
&.has-selection {
|
||||
.category-drop-header {
|
||||
color: var(--quaternary);
|
||||
border-color: var(--quaternary);
|
||||
.caret-icon {
|
||||
color: var(--quaternary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user