FIX: Opening panels by keyboard should respect closing

This commit is contained in:
Robin Ward 2015-08-31 14:51:38 -04:00
parent ca017facf2
commit e5911e7fc4
2 changed files with 9 additions and 3 deletions

View File

@ -18,6 +18,11 @@ const HeaderController = Ember.Controller.extend({
actions: {
toggleMenuPanel(visibleProp) {
this.toggleProperty(visibleProp);
this.appEvents.trigger('dropdowns:closeAll');
},
toggleStar() {
const topic = this.get('topic');
if (topic) topic.toggleStar();

View File

@ -65,6 +65,7 @@ export default {
this.searchService = this.container.lookup('search-service:main');
this.appEvents = this.container.lookup('app-events:main');
_.each(PATH_BINDINGS, this._bindToPath, this);
_.each(CLICK_BINDINGS, this._bindToClick, this);
@ -169,15 +170,15 @@ export default {
},
showSearch() {
this.container.lookup('controller:header').toggleProperty('searchVisible');
this.container.lookup('controller:header').send('toggleMenuPanel', 'searchVisible');
},
toggleHamburgerMenu() {
this.container.lookup('controller:header').toggleProperty('hamburgerVisible');
this.container.lookup('controller:header').send('toggleMenuPanel', 'hamburgerVisible');
},
showCurrentUser() {
this.container.lookup('controller:header').toggleProperty('userMenuVisible');
this.container.lookup('controller:header').send('toggleMenuPanel', 'userMenuVisible');
},
showHelpModal() {