FIX: Subcategory filters were not respecting the current category

This commit is contained in:
Robin Ward 2017-11-01 16:28:23 -04:00
parent a931d7ba56
commit 46b0c01823
2 changed files with 3 additions and 8 deletions

View File

@ -16,10 +16,10 @@ export default Ember.Component.extend({
@computed('category.can_edit')
showCategoryEdit: canEdit => canEdit,
@computed("filterMode")
navItems(filterMode) {
@computed("filterMode", "category", 'noSubcategories')
navItems(filterMode, category, noSubcategories) {
// 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/", ""); }
return Discourse.NavItem.buildList(null, { filterMode });
return Discourse.NavItem.buildList(category, { filterMode, noSubcategories });
}
});

View File

@ -4,9 +4,4 @@ import NavigationDefaultController from 'discourse/controllers/navigation/defaul
export default NavigationDefaultController.extend({
showingParentCategory: Em.computed.none('category.parentCategory'),
showingSubcategoryList: Em.computed.and('category.show_subcategory_list', 'showingParentCategory'),
@computed("showingSubcategoryList", "category", "noSubcategories")
navItems(showingSubcategoryList, category, noSubcategories) {
return Discourse.NavItem.buildList(category, { noSubcategories });
}
});