touch/drag: only prevent draginit for additionnal fingers, but store the touch reference

This commit is contained in:
jean-emmanuel 2016-11-17 12:31:30 +01:00
parent 471a7ce01e
commit 7ec41c599a

View file

@ -134,7 +134,14 @@
if (isNaN(i)) continue
var touch = oE.changedTouches[i],
id = touch.identifier
id = touch.identifier,
emit = true
for (j in targets) {
if (targets[j][0].isSameNode(touch.target)) {
emit = false
}
}
targets[id] = $(touch.target)
previousTouches[id] = touch
@ -149,13 +156,8 @@
touch.offsetX = touch.pageX-off.left
touch.offsetY = touch.pageY-off.top
for (j in targets) {
if (targets[j][0].isSameNode(touch.target)) {
continue touches
}
}
targets[id].triggerHandler('draginit',[touch,e.originalEvent.traversing])
if (emit) targets[id].triggerHandler('draginit',[touch,e.originalEvent.traversing])
}