mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-05-21 18:11:51 +00:00
Abandon swipe altogether if more than one touch detected
This commit is contained in:
parent
7b8f01d839
commit
6be7293a85
1 changed files with 4 additions and 3 deletions
|
|
@ -283,8 +283,8 @@ class Carousel {
|
||||||
|
|
||||||
if (this._pointerEvent && (originEvent.pointerType === PointerType.TOUCH || originEvent.pointerType === PointerType.PEN)) {
|
if (this._pointerEvent && (originEvent.pointerType === PointerType.TOUCH || originEvent.pointerType === PointerType.PEN)) {
|
||||||
this.touchStartX = originEvent.clientX
|
this.touchStartX = originEvent.clientX
|
||||||
} else {
|
} else if (!this._pointerEvent) {
|
||||||
this.touchStartX = originEvent.touches[0].pageX
|
this.touchStartX = originEvent.touches[0].clientX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -293,11 +293,12 @@ class Carousel {
|
||||||
|
|
||||||
// ensure swiping with one touch and not pinching
|
// ensure swiping with one touch and not pinching
|
||||||
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
||||||
|
this.touchDeltaX = 0;
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._pointerEvent) {
|
if (!this._pointerEvent) {
|
||||||
this.touchDeltaX = event.originalEvent.touches[0].pageX - this.touchStartX
|
this.touchDeltaX = event.originalEvent.touches[0].clientX - this.touchStartX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue