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
|
|
@ -36,6 +36,9 @@
|
|||
this.on(events.mouse.start,function(e){
|
||||
e.stopPropagation()
|
||||
|
||||
// ignore mouse event when fired by a simulated touch event
|
||||
if (e.originalEvent.sourceCapabilities.firesTouchEvents) return
|
||||
|
||||
if (e.button==2) {
|
||||
e.preventDefault()
|
||||
$(e.target).trigger('fake-right-click',e)
|
||||
|
|
@ -79,6 +82,9 @@
|
|||
$document.on(events.mouse.stop,function(e){
|
||||
e.stopPropagation()
|
||||
|
||||
// ignore mouse event when fired by a simulated touch event
|
||||
if (e.originalEvent.sourceCapabilities.firesTouchEvents) return
|
||||
|
||||
if (!isPointerDown) return
|
||||
|
||||
e.speedX = e.pageX - previousEvent.pageX
|
||||
|
|
@ -247,12 +253,13 @@
|
|||
|
||||
$document.handleDragging()
|
||||
|
||||
// if (events.touch) {
|
||||
// $document.on('mousedown',function(e){
|
||||
// console.log('ef')
|
||||
// if (e.toElement.tagName!='INPUT') return false
|
||||
// })
|
||||
// }
|
||||
// prevent mouse events to be fired when emulating touch with chrome
|
||||
$document.on('mousedown mouseup',function(e){
|
||||
if (e.originalEvent.sourceCapabilities.firesTouchEvents) {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
}
|
||||
})
|
||||
|
||||
$document.on('contextmenu',function(){return false})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue