mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: allows customHref for extra nav items (#8012)
* DEV: allowes customHref for extra nav item * linting * uses value not key
This commit is contained in:
parent
b8f21ea962
commit
00b91de5e8
@ -101,8 +101,19 @@ const NavItem = Discourse.Model.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const ExtraNavItem = NavItem.extend({
|
const ExtraNavItem = NavItem.extend({
|
||||||
@computed("href")
|
href: Ember.computed({
|
||||||
href: href => href,
|
set(key, value) {
|
||||||
|
let customHref;
|
||||||
|
NavItem.customNavItemHrefs.forEach(function(cb) {
|
||||||
|
customHref = cb.call(this, this);
|
||||||
|
if (customHref) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}, this);
|
||||||
|
return customHref || value;
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
customFilter: null
|
customFilter: null
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user