From b4cb31d999341e408ae9a53195ecdb8ece948b2b Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 2 Jul 2018 14:52:02 +0200 Subject: [PATCH] FIX: disabled topic timeline panning on desktop --- .../discourse/mixins/pan-events.js.es6 | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/discourse/mixins/pan-events.js.es6 b/app/assets/javascripts/discourse/mixins/pan-events.js.es6 index 5188d8639d6..93792317e91 100644 --- a/app/assets/javascripts/discourse/mixins/pan-events.js.es6 +++ b/app/assets/javascripts/discourse/mixins/pan-events.js.es6 @@ -4,19 +4,27 @@ export default Ember.Mixin.create({ _panState: null, didInsertElement() { - this.$() - .on("pointerdown", e => this._panStart(e)) - .on("pointermove", e => this._panMove(e)) - .on("pointerup", e => this._panMove(e)) - .on("pointercancel", e => this._panMove(e)); + this._super(); + + if (this.site.mobileView) { + this.$() + .on("pointerdown", e => this._panStart(e)) + .on("pointermove", e => this._panMove(e)) + .on("pointerup", e => this._panMove(e)) + .on("pointercancel", e => this._panMove(e)); + } }, willDestroyElement() { - this.$() - .off("pointerdown") - .off("pointerup") - .off("pointermove") - .off("pointercancel"); + this._super(); + + if (this.site.mobileView) { + this.$() + .off("pointerdown") + .off("pointerup") + .off("pointermove") + .off("pointercancel"); + } }, _calculateNewPanState(oldState, e) {