DEV: Make context available to ExtraNavItems
This context is available to other NavItems so this makes things more consistent.
This commit is contained in:
parent
5c59247c3a
commit
337fdccfeb
|
@ -198,8 +198,14 @@ NavItem.reopenClass({
|
|||
i => i !== null && !(category && i.get("name").indexOf("categor") === 0)
|
||||
);
|
||||
|
||||
const context = {
|
||||
category: args.category,
|
||||
tagId: args.tagId,
|
||||
noSubcategories: args.noSubcategories
|
||||
};
|
||||
|
||||
const extraItems = NavItem.extraNavItemDescriptors
|
||||
.map(descriptor => ExtraNavItem.create(descriptor))
|
||||
.map(descriptor => ExtraNavItem.create(_.merge({}, context, descriptor)))
|
||||
.filter(item => {
|
||||
if (!item.customFilter) return true;
|
||||
return item.customFilter(category, args);
|
||||
|
|
Loading…
Reference in New Issue