mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
FIX: When navigating to pages close panels
This commit is contained in:
parent
82ad3e0401
commit
ca017facf2
1 changed files with 2 additions and 2 deletions
|
@ -59,8 +59,6 @@ export default Ember.Component.extend({
|
||||||
@observes('viewMode', 'visible')
|
@observes('viewMode', 'visible')
|
||||||
_visibleChanged() {
|
_visibleChanged() {
|
||||||
if (this.get('visible')) {
|
if (this.get('visible')) {
|
||||||
this.appEvents.on('dropdowns:closeAll', this, this.hide);
|
|
||||||
|
|
||||||
// Allow us to hook into things being shown
|
// Allow us to hook into things being shown
|
||||||
Ember.run.scheduleOnce('afterRender', () => this.sendAction('onVisible'));
|
Ember.run.scheduleOnce('afterRender', () => this.sendAction('onVisible'));
|
||||||
$('html').on('click.close-menu-panel', (e) => {
|
$('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('dropdowns:closeAll', this, this.hide);
|
||||||
|
this.appEvents.on('dom:clean', this, this.hide);
|
||||||
|
|
||||||
$('body').on('keydown.discourse-menu-panel', (e) => {
|
$('body').on('keydown.discourse-menu-panel', (e) => {
|
||||||
if (e.which === 27) {
|
if (e.which === 27) {
|
||||||
|
@ -157,6 +156,7 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
@on('willDestroyElement')
|
@on('willDestroyElement')
|
||||||
_removeEvents() {
|
_removeEvents() {
|
||||||
|
this.appEvents.off('dom:clean', this, this.hide);
|
||||||
this.appEvents.off('dropdowns:closeAll', this, this.hide);
|
this.appEvents.off('dropdowns:closeAll', this, this.hide);
|
||||||
this.$().off('click.discourse-menu-panel');
|
this.$().off('click.discourse-menu-panel');
|
||||||
$('body').off('keydown.discourse-menu-panel');
|
$('body').off('keydown.discourse-menu-panel');
|
||||||
|
|
Loading…
Reference in a new issue