From: patrickhlauke Date: Mon, 15 Oct 2018 20:54:20 +0000 (+0100) Subject: Abandon swipe altogether if more than one touch detected X-Git-Tag: v4.2.0~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6be7293a85e401f9937cfb2d1bb5d4df9b35b6d2;p=thirdparty%2Fbootstrap.git Abandon swipe altogether if more than one touch detected --- diff --git a/js/src/carousel.js b/js/src/carousel.js index f0ad83bb0b..997424bfac 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -283,8 +283,8 @@ class Carousel { if (this._pointerEvent && (originEvent.pointerType === PointerType.TOUCH || originEvent.pointerType === PointerType.PEN)) { this.touchStartX = originEvent.clientX - } else { - this.touchStartX = originEvent.touches[0].pageX + } else if (!this._pointerEvent) { + this.touchStartX = originEvent.touches[0].clientX } } @@ -293,11 +293,12 @@ class Carousel { // ensure swiping with one touch and not pinching if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { + this.touchDeltaX = 0; return } if (!this._pointerEvent) { - this.touchDeltaX = event.originalEvent.touches[0].pageX - this.touchStartX + this.touchDeltaX = event.originalEvent.touches[0].clientX - this.touchStartX } }