DEV: No need to use call to call these callbacks

This is safe because addNavigationBarItem decorates these callbacks,
throwing away the context.
This commit is contained in:
Daniel Waterworth 2019-11-13 09:33:17 +00:00
parent 5ff84be8cc
commit 60e804ad5c

View File

@ -164,14 +164,14 @@ NavItem.reopenClass({
const extraItems = NavItem.extraNavItems.filter(item => {
if (!item.customFilter) return true;
return item.customFilter.call(this, category, args);
return item.customFilter(category, args);
});
let forceActive = false;
extraItems.forEach(item => {
if (item.init) {
item.init.call(this, item, category, args);
item.init(item, category, args);
}
const before = item.before;
@ -189,9 +189,9 @@ NavItem.reopenClass({
if (!item.customHref) return;
item.set("href", item.customHref.call(this, category, args));
item.set("href", item.customHref(category, args));
if (item.forceActive && item.forceActive.call(this, category, args)) {
if (item.forceActive && item.forceActive(category, args)) {
item.active = true;
forceActive = true;
} else {