|
@@ -154,26 +154,7 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * filters mouse events so an event is fired only if the mouse moved.
|
|
|
|
- *
|
|
|
|
- * filters out mouse events that occur when mouse is stationary but
|
|
|
|
- * the elements under the pointer are scrolled.
|
|
|
|
- */
|
|
|
|
- function installFilteredMouseMove(element) {
|
|
|
|
- var context = $(element[0].document);
|
|
|
|
- context.on("mousemove", function (e) {
|
|
|
|
- context.data("select2-lastpos", {x: e.pageX, y: e.pageY});
|
|
|
|
- });
|
|
|
|
- element.bind("mousemove", function (e) {
|
|
|
|
- var lastpos = context.data("select2-lastpos");
|
|
|
|
- if (lastpos === undefined || lastpos.x !== e.pageX || lastpos.y !== e.pageY) {
|
|
|
|
- $(e.target).trigger("mousemove-filtered", e);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
|
|
+ /**
|
|
* Debounces a function. Returns a function that calls the original fn function only if no invocations have been made
|
|
* Debounces a function. Returns a function that calls the original fn function only if no invocations have been made
|
|
* within the last quietMillis milliseconds.
|
|
* within the last quietMillis milliseconds.
|
|
*
|
|
*
|
|
@@ -422,7 +403,6 @@
|
|
// initialize the container
|
|
// initialize the container
|
|
this.initContainer();
|
|
this.initContainer();
|
|
|
|
|
|
- //installFilteredMouseMove(this.results);
|
|
|
|
this.dropdown.delegate(resultsSelector, "mouseover", this.bind(this.highlightUnderEvent));
|
|
this.dropdown.delegate(resultsSelector, "mouseover", this.bind(this.highlightUnderEvent));
|
|
|
|
|
|
installDebouncedScroll(80, this.results);
|
|
installDebouncedScroll(80, this.results);
|