mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 708538 - Use setTimeout(..., 0) to send the click event from touch.js. r=cjones
This commit is contained in:
parent
a38ad5a40c
commit
54a60f2f4b
@ -151,18 +151,17 @@
|
|||||||
// Mouse events has been cancelled so dispatch a sequence
|
// Mouse events has been cancelled so dispatch a sequence
|
||||||
// of events to where touchend has been fired
|
// of events to where touchend has been fired
|
||||||
if (preventMouseEvents) {
|
if (preventMouseEvents) {
|
||||||
let target = evt.target;
|
|
||||||
ignoreEvents = true;
|
|
||||||
try {
|
|
||||||
this.fireMouseEvent('mousemove', evt);
|
|
||||||
this.fireMouseEvent('mousedown', evt);
|
|
||||||
this.fireMouseEvent('mouseup', evt);
|
|
||||||
} catch (e) {
|
|
||||||
alert(e);
|
|
||||||
}
|
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
ignoreEvents = false;
|
|
||||||
|
let target = evt.target;
|
||||||
|
ignoreEvents = true;
|
||||||
|
window.setTimeout(function dispatchMouseEvents(self) {
|
||||||
|
self.fireMouseEvent('mousemove', evt);
|
||||||
|
self.fireMouseEvent('mousedown', evt);
|
||||||
|
self.fireMouseEvent('mouseup', evt);
|
||||||
|
ignoreEvents = false;
|
||||||
|
}, 0, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
debug('click: fire');
|
debug('click: fire');
|
||||||
|
Loading…
Reference in New Issue
Block a user