From 7ec41c599ab4d389eae4d30b85475158d2ca142a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 17 Nov 2016 12:31:30 +0100 Subject: [PATCH] touch/drag: only prevent draginit for additionnal fingers, but store the touch reference --- src/browser/js/jquery/jquery.drag.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/browser/js/jquery/jquery.drag.js b/src/browser/js/jquery/jquery.drag.js index a1e0a462..ab1312ec 100644 --- a/src/browser/js/jquery/jquery.drag.js +++ b/src/browser/js/jquery/jquery.drag.js @@ -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]) }