touch-drag: only compute elementFromPoint if shift key is pressed

This commit is contained in:
jean-emmanuel 2016-02-29 10:14:47 +01:00
parent c61cad7d24
commit 881c050f12

View file

@ -89,8 +89,10 @@
element.on("touchmove.drag", function(e) {
e.preventDefault()
// get element under pointer: usefull only for master dragging (when target changes during drag)
e.target = document.elementFromPoint(e.originalEvent.changedTouches[0].clientX, e.originalEvent.changedTouches[0].clientY)
if (e.shiftKey) {
// get element under pointer: usefull only for master dragging (when target changes during drag)
e.target = document.elementFromPoint(e.originalEvent.changedTouches[0].clientX, e.originalEvent.changedTouches[0].clientY)
}
e.pageX = e.originalEvent.targetTouches[0].pageX
e.pageY = e.originalEvent.targetTouches[0].pageY