Fix for touchscreen devices that also have a mouse.

This commit is contained in:
zarmhast 2016-06-04 23:12:26 +00:00 committed by Samuel Mannehed
parent 5826ab6f6a
commit 4b20f2364c
1 changed files with 12 additions and 14 deletions

View File

@ -351,14 +351,13 @@
window.addEventListener('touchend', this._eventHandlers.mouseup);
c.addEventListener('touchend', this._eventHandlers.mouseup);
c.addEventListener('touchmove', this._eventHandlers.mousemove);
} else {
c.addEventListener('mousedown', this._eventHandlers.mousedown);
window.addEventListener('mouseup', this._eventHandlers.mouseup);
c.addEventListener('mouseup', this._eventHandlers.mouseup);
c.addEventListener('mousemove', this._eventHandlers.mousemove);
c.addEventListener((Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel',
this._eventHandlers.mousewheel);
}
c.addEventListener('mousedown', this._eventHandlers.mousedown);
window.addEventListener('mouseup', this._eventHandlers.mouseup);
c.addEventListener('mouseup', this._eventHandlers.mouseup);
c.addEventListener('mousemove', this._eventHandlers.mousemove);
c.addEventListener((Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel',
this._eventHandlers.mousewheel);
/* Work around right and middle click browser behaviors */
document.addEventListener('click', this._eventHandlers.mousedisable);
@ -373,14 +372,13 @@
window.removeEventListener('touchend', this._eventHandlers.mouseup);
c.removeEventListener('touchend', this._eventHandlers.mouseup);
c.removeEventListener('touchmove', this._eventHandlers.mousemove);
} else {
c.removeEventListener('mousedown', this._eventHandlers.mousedown);
window.removeEventListener('mouseup', this._eventHandlers.mouseup);
c.removeEventListener('mouseup', this._eventHandlers.mouseup);
c.removeEventListener('mousemove', this._eventHandlers.mousemove);
c.removeEventListener((Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel',
this._eventHandlers.mousewheel);
}
c.removeEventListener('mousedown', this._eventHandlers.mousedown);
window.removeEventListener('mouseup', this._eventHandlers.mouseup);
c.removeEventListener('mouseup', this._eventHandlers.mouseup);
c.removeEventListener('mousemove', this._eventHandlers.mousemove);
c.removeEventListener((Util.Engine.gecko) ? 'DOMMouseScroll' : 'mousewheel',
this._eventHandlers.mousewheel);
/* Work around right and middle click browser behaviors */
document.removeEventListener('click', this._eventHandlers.mousedisable);