aboutsummaryrefslogtreecommitdiffstats
path: root/ui/tests/ui.testmouse.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/tests/ui.testmouse.js')
-rw-r--r--ui/tests/ui.testmouse.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/ui/tests/ui.testmouse.js b/ui/tests/ui.testmouse.js
index d629e4bff..5b73ab013 100644
--- a/ui/tests/ui.testmouse.js
+++ b/ui/tests/ui.testmouse.js
@@ -11,21 +11,21 @@
var mouseX = 0;
var mouseY = 0;
-
+
+ $(function() {
+ $(document).mousemove(function(e) {
+ if (e.isTrusted !== false) {
+ mouseX = e.pageX;
+ mouseY = e.pageY;
+ }
+ });
+ });
+
$.widget("ui.testMouse", {
trackMouse: function() {},
init: function() {
- var self = this;
- this.trackMouse = function(e) {
- if (e.isTrusted !== false) {
- mouseX = e.pageX;
- mouseY = e.pageY;
- }
- }
- $(document).bind("mousemove", this.trackMouse);
},
destroy: function() {
- $(document).unbind("mousemove", this.trackMouse);
},
center: function(offset) {
var o = this.element.offset();