1
0
mirror of synced 2024-11-25 22:36:03 +03:00

optimize global mousemove listener

This commit is contained in:
Igor Vaynberg 2012-07-17 12:38:09 +03:00
parent 0aea42fe42
commit 33e8e20159

View File

@ -163,7 +163,7 @@
}
$(document).delegate("*", "mousemove", function (e) {
$(document).data("select2-lastpos", {x: e.pageX, y: e.pageY});
$.data(document, "select2-lastpos", {x: e.pageX, y: e.pageY});
});
/**
@ -174,7 +174,7 @@
*/
function installFilteredMouseMove(element) {
element.bind("mousemove", function (e) {
var lastpos = $(document).data("select2-lastpos");
var lastpos = $.data(document, "select2-lastpos");
if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
$(e.target).trigger("mousemove-filtered", e);
}