Bug 708538 - Use setTimeout(..., 0) to send the click event from touch.js. r=cjones

This commit is contained in:
Vivien Nicolas 2011-12-09 09:16:11 +08:00
parent a38ad5a40c
commit 54a60f2f4b

View File

@ -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');