From f11bdd13fcdf0952bed3d912afe48266636ce295 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 2 Sep 2015 15:12:35 -0400 Subject: [PATCH] FIX: Menu panels scrolled weird in iOS --- .../javascripts/discourse/components/menu-panel.js.es6 | 8 ++++++-- 1 file changed, 6 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 a6a0b725a5e..18a36917c00 100644 --- a/app/assets/javascripts/discourse/components/menu-panel.js.es6 +++ b/app/assets/javascripts/discourse/components/menu-panel.js.es6 @@ -79,7 +79,11 @@ export default Ember.Component.extend({ }); this.performLayout(); this._watchSizeChanges(); - $(window).on('scroll.discourse-menu-panel', () => this.performLayout()); + + // iOS does not handle scroll events well + if (!this.capabilities.touch) { + $(window).on('scroll.discourse-menu-panel', () => this.performLayout()); + } } else { Ember.run.scheduleOnce('afterRender', () => this.sendAction('onHidden')); $('html').off('click.close-menu-panel'); @@ -175,7 +179,7 @@ export default Ember.Component.extend({ $('body').off('keydown.discourse-menu-panel'); $('html').off('click.close-menu-panel'); $(window).off('resize.discourse-menu-panel'); - $(window).off('scroll.discourse-menu-panel'); + $(window).off('scroll.discourse-menu-panel'); }, hide() {