drag: prevent touchmove event that have no target
This commit is contained in:
parent
ba10ec2d18
commit
6abc0a16c3
1 changed files with 3 additions and 3 deletions
|
|
@ -125,11 +125,10 @@
|
|||
|
||||
var self = this,
|
||||
touchStartHandler = function(e){
|
||||
e.preventDefault()
|
||||
|
||||
var oE = e.originalEvent
|
||||
|
||||
if (!oE.traversing) e.preventDefault()
|
||||
|
||||
for (i in oE.changedTouches) {
|
||||
if (isNaN(i) || !oE.changedTouches[i]) continue
|
||||
|
||||
|
|
@ -191,6 +190,7 @@
|
|||
targets[id] = $(document.elementFromPoint(touch.clientX, touch.clientY))
|
||||
}
|
||||
|
||||
if (!targets[id]) continue
|
||||
|
||||
touch.speedX = (touch.pageX - previousTouches[id].pageX) / speedFactor
|
||||
touch.speedY = (touch.pageY - previousTouches[id].pageY) / speedFactor
|
||||
|
|
@ -297,9 +297,9 @@
|
|||
|
||||
this.on('disableTraversingGestures',()=>{
|
||||
this.off('draginit.traversing')
|
||||
this.off('disableTraversingGestures')
|
||||
self.removeEventListener("mousedown", down, true)
|
||||
self.removeEventListener("touchstart", down, true)
|
||||
this.o
|
||||
})
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue