diff options
| author | patrickhlauke <[email protected]> | 2018-10-15 21:54:20 +0100 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2018-10-20 15:32:09 +0300 |
| commit | 6be7293a85e401f9937cfb2d1bb5d4df9b35b6d2 (patch) | |
| tree | 041027e2dd7e28fcb72a44ae4cd683c9ecb128d9 | |
| parent | 7b8f01d839aa2d2683bd5f90f79fe632d58bf9a4 (diff) | |
| download | bootstrap-6be7293a85e401f9937cfb2d1bb5d4df9b35b6d2.tar.xz bootstrap-6be7293a85e401f9937cfb2d1bb5d4df9b35b6d2.zip | |
Abandon swipe altogether if more than one touch detected
| -rw-r--r-- | js/src/carousel.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index f0ad83bb0..997424bfa 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 } } |
