compute offsetX/Y for touch fake-right-click
-> pasted widgets now use correct pointer position
This commit is contained in:
parent
f6e0bb4c38
commit
54c900599f
2 changed files with 16 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue