DEV: allows customHref for extra nav items (#8012)

DEV: allows customHref for extra nav items (#8012)

  • DEV: allowes customHref for extra nav item

  • linting

  • uses value not key

diff --git a/app/assets/javascripts/discourse/models/nav-item.js.es6 b/app/assets/javascripts/discourse/models/nav-item.js.es6
index 8fd5d08..b4c725d 100644
--- a/app/assets/javascripts/discourse/models/nav-item.js.es6
+++ b/app/assets/javascripts/discourse/models/nav-item.js.es6
@@ -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
 });

GitHub sha: 00b91de5