app/assets/javascripts/pageflow/slideshow/scroller_widget.js in pageflow-13.1.0 vs app/assets/javascripts/pageflow/slideshow/scroller_widget.js in pageflow-13.2.0

- old
+ new

@@ -11,16 +11,21 @@ maxXDelta: 50, maxYDelta: 50, doubleBumpThreshold: 500, _create: function() { + this.eventListenerTarget = this.options.eventListenerTarget ? + $(this.options.eventListenerTarget) : + this.element; + this.iscroll = new IScroll(this.element[0], _.extend({ mouseWheel: true, bounce: false, keyBindings: true, probeType: 2, - preventDefault: false + preventDefault: false, + eventListenerTarget: this.eventListenerTarget[0] }, _.pick(this.options, 'freeScroll', 'scrollX', 'noMouseWheelScrollX'))); this.iscroll.disable(); if (pageflow.entryData.getThemingOption('page_change_by_scrolling')) { @@ -216,11 +221,11 @@ allowDown = false, allowLeft = false, allowRight = false, startX, startY; - this.element.on('touchstart MSPointerDown pointerdown', _.bind(function(event) { + this.eventListenerTarget.on('touchstart MSPointerDown pointerdown', _.bind(function(event) { var point = event.originalEvent.touches ? event.originalEvent.touches[0] : event.originalEvent; startX = point.pageX; startY = point.pageY; @@ -231,11 +236,11 @@ allowLeft = true; allowRight = true; } }, this)); - this.element.on('touchmove MSPointerMove pointermove', _.bind(function(event) { + this.eventListenerTarget.on('touchmove MSPointerMove pointermove', _.bind(function(event) { var point = event.originalEvent.touches ? event.originalEvent.touches[0] : event.originalEvent; var deltaX = point.pageX - startX; var deltaY = point.pageY - startY; @@ -264,10 +269,10 @@ this._trigger('bumpright'); allowDown = allowUp = allowLeft = allowRight =false; } }, this)); - this.element.on('touchend MSPointerUp pointerup', _.bind(function(event) { + this.eventListenerTarget.on('touchend MSPointerUp pointerup', _.bind(function(event) { var point = event.originalEvent.touches ? event.originalEvent.changedTouches[0] : event.originalEvent; var deltaX = point.pageX - startX; var deltaY = point.pageY - startY;