FIX: Subcategory filters were not respecting the current category
This commit is contained in:
parent
a931d7ba56
commit
46b0c01823
app/assets/javascripts/discourse
|
@ -16,10 +16,10 @@ export default Ember.Component.extend({
|
||||||
@computed('category.can_edit')
|
@computed('category.can_edit')
|
||||||
showCategoryEdit: canEdit => canEdit,
|
showCategoryEdit: canEdit => canEdit,
|
||||||
|
|
||||||
@computed("filterMode")
|
@computed("filterMode", "category", 'noSubcategories')
|
||||||
navItems(filterMode) {
|
navItems(filterMode, category, noSubcategories) {
|
||||||
// we don't want to show the period in the navigation bar since it's in a dropdown
|
// we don't want to show the period in the navigation bar since it's in a dropdown
|
||||||
if (filterMode.indexOf("top/") === 0) { filterMode = filterMode.replace("top/", ""); }
|
if (filterMode.indexOf("top/") === 0) { filterMode = filterMode.replace("top/", ""); }
|
||||||
return Discourse.NavItem.buildList(null, { filterMode });
|
return Discourse.NavItem.buildList(category, { filterMode, noSubcategories });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,9 +4,4 @@ import NavigationDefaultController from 'discourse/controllers/navigation/defaul
|
||||||
export default NavigationDefaultController.extend({
|
export default NavigationDefaultController.extend({
|
||||||
showingParentCategory: Em.computed.none('category.parentCategory'),
|
showingParentCategory: Em.computed.none('category.parentCategory'),
|
||||||
showingSubcategoryList: Em.computed.and('category.show_subcategory_list', 'showingParentCategory'),
|
showingSubcategoryList: Em.computed.and('category.show_subcategory_list', 'showingParentCategory'),
|
||||||
|
|
||||||
@computed("showingSubcategoryList", "category", "noSubcategories")
|
|
||||||
navItems(showingSubcategoryList, category, noSubcategories) {
|
|
||||||
return Discourse.NavItem.buildList(category, { noSubcategories });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue