diff --git a/app/assets/javascripts/discourse/components/hamburger-menu.js.es6 b/app/assets/javascripts/discourse/components/hamburger-menu.js.es6 index 9dc957ed8c0..32e7d194a3f 100644 --- a/app/assets/javascripts/discourse/components/hamburger-menu.js.es6 +++ b/app/assets/javascripts/discourse/components/hamburger-menu.js.es6 @@ -7,14 +7,21 @@ export default Ember.Component.extend({ visibilityChanged: function(){ if(this.get("visible")) { $('html').on('click.close-humburger', (e) => { + + if (this.get('isDestroyed')) { + $('html').off('click.close-humburger'); + return true; + } + const $target = $(e.target); if ($target.closest('.dropdown.categories').length > 0) { return; } - console.log(e.toElement || e.relatedTarget || e.target); + this.set("visible", false); $('html').off('click.close-humburger'); return true; + }); } else { $('html').off('click.close-humburger'); diff --git a/app/assets/javascripts/discourse/templates/components/hamburger-menu.hbs b/app/assets/javascripts/discourse/templates/components/hamburger-menu.hbs index b85ffb0b92c..7cef85af937 100644 --- a/app/assets/javascripts/discourse/templates/components/hamburger-menu.hbs +++ b/app/assets/javascripts/discourse/templates/components/hamburger-menu.hbs @@ -2,77 +2,78 @@
{{fa-icon 'times'}}
-