Skip to content
Permalink
Browse files

mouse: cleanup

  • Loading branch information
scottgonzalez committed May 28, 2008
1 parent 1f360d7 commit dd096c1e95b4f89706de3201fec85adeebf94edb
Showing with 6 additions and 8 deletions.
  1. +6 −8 ui/source/ui.core.js
@@ -173,6 +173,8 @@
this.started = false;
},

// TODO: make sure destroying one instance of mouse doesn't mess with
// other instances of mouse
mouseDestroy: function() {
this.element.unbind('.mouse');

@@ -182,10 +184,8 @@
},

mouseDown: function(e) {

// we may have missed mouseup (out of window)
(this._mouseStarted
&& this.mouseUp(e));
(this._mouseStarted && this.mouseUp(e));

this._mouseDownEvent = e;

@@ -196,7 +196,7 @@
return true;
}

this._mouseDelayMet = (this.options.delay == 0);
this._mouseDelayMet = !this.options.delay;
if (!this._mouseDelayMet) {
this._mouseDelayTimer = setTimeout(function() {
self._mouseDelayMet = true;
@@ -206,10 +206,10 @@
// these delegates are required to keep context
this._mouseMoveDelegate = function(e) {
return self.mouseMove(e);
}
};
this._mouseUpDelegate = function(e) {
return self.mouseUp(e);
}
};
$(document)
.bind('mousemove.mouse', this._mouseMoveDelegate)
.bind('mouseup.mouse', this._mouseUpDelegate);
@@ -218,7 +218,6 @@
},

mouseMove: function(e) {

// IE mouseup check - mouseup happened when mouse was out of window
if ($.browser.msie && !e.button) {
return this.mouseUp(e);
@@ -239,7 +238,6 @@
},

mouseUp: function(e) {

$(document)
.unbind('mousemove.mouse', this._mouseMoveDelegate)
.unbind('mouseup.mouse', this._mouseUpDelegate);

0 comments on commit dd096c1

Please sign in to comment.
You can’t perform that action at this time.