diff --git a/app/components/nav-menu.js b/app/components/nav-menu.js index 40c0c6f80e..86501c16b1 100644 --- a/app/components/nav-menu.js +++ b/app/components/nav-menu.js @@ -14,6 +14,9 @@ export default Ember.Component.extend(UserSession, { _setup: function() { let nav = this.get("nav"); + nav.closeSubnav = function() { + this.set('isShowing', false); + }.bind(this); nav.subnav.forEach(function(item) { item.show = this.currentUserCan(item.capability); }.bind(this)); diff --git a/app/controllers/navigation.js b/app/controllers/navigation.js index a22ee7177f..e028e4a577 100644 --- a/app/controllers/navigation.js +++ b/app/controllers/navigation.js @@ -11,6 +11,7 @@ export default Ember.Controller.extend(ProgressDialog, UserSession, Navigation, progressTitle: 'Searching', searchRoute: null, syncStatus: '', + currentOpenNav: null, actions: { search: function() { @@ -28,6 +29,10 @@ export default Ember.Controller.extend(ProgressDialog, UserSession, Navigation, }, navAction: function(nav) { + if (this.currentOpenNav) { + this.currentOpenNav.closeSubnav(); + } + this.currentOpenNav = nav; this.transitionToRoute(nav.route); }, diff --git a/app/templates/components/nav-menu.hbs b/app/templates/components/nav-menu.hbs index 72baf80d7c..13f6d94e4b 100644 --- a/app/templates/components/nav-menu.hbs +++ b/app/templates/components/nav-menu.hbs @@ -1,9 +1,9 @@ {{log this}} {{#if show}} -