From 70f1b29882510b082a328f3c947b19aec19dc151 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Fri, 17 May 2013 08:13:31 -0700 Subject: [PATCH] optimize mousemove listener. fixes #1328 --- select2.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 5822094d..fe4caafd 100644 --- a/select2.js +++ b/select2.js @@ -47,7 +47,7 @@ the specific language governing permissions and limitations under the Apache Lic } var KEY, AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer, - lastMousePosition, $document, scrollBarDimensions, + lastMousePosition={x:0,y:0}, $document, scrollBarDimensions, KEY = { TAB: 9, @@ -172,7 +172,8 @@ the specific language governing permissions and limitations under the Apache Lic } $document.on("mousemove", function (e) { - lastMousePosition = {x: e.pageX, y: e.pageY}; + lastMousePosition.x = e.pageX; + lastMousePosition.y = e.pageY; }); /**