From 2a4a984ba5f6a9ba775ca80624481e3807e6f569 Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Mon, 17 Nov 2014 21:47:48 +0100 Subject: [PATCH] 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 --- resources/mmv/mmv.lightboxinterface.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/mmv/mmv.lightboxinterface.js b/resources/mmv/mmv.lightboxinterface.js index 285067105..e33a6ad6d 100644 --- a/resources/mmv/mmv.lightboxinterface.js +++ b/resources/mmv/mmv.lightboxinterface.js @@ -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