From: Scott González Date: Wed, 28 May 2008 14:02:56 +0000 (+0000) Subject: mouse: cleanup X-Git-Tag: 1.5.1~284 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dd096c1e95b4f89706de3201fec85adeebf94edb;p=jquery-ui.git mouse: cleanup --- diff --git a/ui/source/ui.core.js b/ui/source/ui.core.js index e9621f6dc..f9b76aa4f 100644 --- a/ui/source/ui.core.js +++ b/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);