Commit 52e6132d 52e6132d04485664ce34fab588cb2a45c4eac5df by Chris Lorenzo

Change mouse event to include an X + Y value for client position

1 parent 5ed461e8
......@@ -423,7 +423,18 @@
}
try {
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent(type, true, true, window, 1, 1, 1, 1, 1, false, false, false, false, 0, elem);
try {
var pos = elem.getBoundingClientRect(),
center_x = Math.floor((pos.left + pos.right) / 2),
center_y = Math.floor((pos.top + pos.bottom) / 2);
} catch(e) {
var center_x = 1, center_y = 1;
}
evt.initMouseEvent(type, true, true, window, 1, 1, 1, center_x, center_y, false, false, false, false, 0, elem);
// dispatchEvent return value is false if at least one of the event
// handlers which handled this event called preventDefault;
// so we cannot returns this results as it cannot accurately informs on the status
......