compute offsetX/Y for touch fake-right-click

-> pasted widgets now use correct pointer position
This commit is contained in:
bordun 2016-06-06 18:33:25 +02:00
parent f6e0bb4c38
commit 54c900599f
2 changed files with 16 additions and 2 deletions

View file

@ -4369,7 +4369,14 @@ require('./app')
if (!touchTapTimer&&e.originalEvent.touches.length==1) {
touchTapTimer = setTimeout(function(){
if (touchTapTimer) $(e.originalEvent.changedTouches[0].target).trigger('fake-right-click',e.originalEvent.changedTouches[0])
if (touchTapTimer) {
var touch = e.originalEvent.changedTouches[0],
off = getOffset(touch.target)
touch.offsetX = touch.pageX-off.left
touch.offsetY = touch.pageY-off.top
$(e.originalEvent.changedTouches[0].target).trigger('fake-right-click',touch)
}
touchTapTimer = false
},600)
} else {

View file

@ -313,7 +313,14 @@
if (!touchTapTimer&&e.originalEvent.touches.length==1) {
touchTapTimer = setTimeout(function(){
if (touchTapTimer) $(e.originalEvent.changedTouches[0].target).trigger('fake-right-click',e.originalEvent.changedTouches[0])
if (touchTapTimer) {
var touch = e.originalEvent.changedTouches[0],
off = getOffset(touch.target)
touch.offsetX = touch.pageX-off.left
touch.offsetY = touch.pageY-off.top
$(e.originalEvent.changedTouches[0].target).trigger('fake-right-click',touch)
}
touchTapTimer = false
},600)
} else {