From ca017facf2b91aeb88190211e4b0bb4eda344187 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 31 Aug 2015 14:43:11 -0400 Subject: [PATCH] FIX: When navigating to pages close panels --- app/assets/javascripts/discourse/components/menu-panel.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/components/menu-panel.js.es6 b/app/assets/javascripts/discourse/components/menu-panel.js.es6 index 5bcb736490a..f8e2c9f80b7 100644 --- a/app/assets/javascripts/discourse/components/menu-panel.js.es6 +++ b/app/assets/javascripts/discourse/components/menu-panel.js.es6 @@ -59,8 +59,6 @@ export default Ember.Component.extend({ @observes('viewMode', 'visible') _visibleChanged() { if (this.get('visible')) { - this.appEvents.on('dropdowns:closeAll', this, this.hide); - // Allow us to hook into things being shown Ember.run.scheduleOnce('afterRender', () => this.sendAction('onVisible')); $('html').on('click.close-menu-panel', (e) => { @@ -134,6 +132,7 @@ export default Ember.Component.extend({ }); this.appEvents.on('dropdowns:closeAll', this, this.hide); + this.appEvents.on('dom:clean', this, this.hide); $('body').on('keydown.discourse-menu-panel', (e) => { if (e.which === 27) { @@ -157,6 +156,7 @@ export default Ember.Component.extend({ @on('willDestroyElement') _removeEvents() { + this.appEvents.off('dom:clean', this, this.hide); this.appEvents.off('dropdowns:closeAll', this, this.hide); this.$().off('click.discourse-menu-panel'); $('body').off('keydown.discourse-menu-panel');