mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -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({
|
||||
@computed("href")
|
||||
href: href => href,
|
||||
href: Ember.computed({
|
||||
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
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user