ignore mouse events fired by simulated touch events
This commit is contained in:
parent
dcb39d6d43
commit
598cbd1099
4 changed files with 38 additions and 12 deletions
|
|
@ -37,6 +37,9 @@ var menu = function(e,actions,parent){
|
|||
$(`<div class="item">${label}</div>`).on(ev + '.editor',function(){
|
||||
var callback = actions[label]
|
||||
return function(e){
|
||||
// ignore mouse event when fired by a simulated touch event
|
||||
if (e.originalEvent.sourceCapabilities.firesTouchEvents) return
|
||||
|
||||
callback()
|
||||
$('.context-menu').remove()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ var init = function(){
|
|||
|
||||
if (!EDITING) return
|
||||
|
||||
// ignore mouse event when fired by a simulated touch event
|
||||
if (e.type=='mousedown' && e.originalEvent.sourceCapabilities.firesTouchEvents) return
|
||||
|
||||
$('.context-menu').remove()
|
||||
|
||||
var target = $(e.target).is('.widget:not(.not-editable), .tab, [data-tab], #container')?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue