Ignore fake mousemove event triggered by Chrome

These happen due to certain DOM changes. It's a hack in Chrome's
code and it seems to have gotten worse with a recent Chrome update,
causing this bug. Thankfully the fake event can be identified easily.

Change-Id: I1688054f5d57147a445db5116a6aafeb1f49ddc4
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/989
This commit is contained in:
Gilles Dubuc 2014-11-17 21:47:48 +01:00 committed by Gergő Tisza
parent 18ba5c1a76
commit 2a4a984ba5

View file

@ -395,6 +395,16 @@
* @param {jQuery.Event} e The mousemove event object
*/
LIP.mousemove = function ( e ) {
// This is a fake mousemove event triggered by Chrome, ignore it
if (
e
&& e.originalEvent
&& e.originalEvent.webkitMovementX === 0
&& e.originalEvent.webkitMovementY === 0
) {
return;
}
if ( e ) {
// Saving the mouse position is useful whenever we need to
// run LIP.mousemove manually, such as when going to the next/prev