]> source.dussan.org Git - jquery-ui.git/commitdiff
mouse: cleanup
authorScott González <scott.gonzalez@gmail.com>
Wed, 28 May 2008 14:02:56 +0000 (14:02 +0000)
committerScott González <scott.gonzalez@gmail.com>
Wed, 28 May 2008 14:02:56 +0000 (14:02 +0000)
ui/source/ui.core.js

index e9621f6dc701184acc7c6dadc9deb415896db294..f9b76aa4fd60ed66ceafe4d2f034019d61614592 100644 (file)
                        this.started = false;\r
                },\r
                \r
+               // TODO: make sure destroying one instance of mouse doesn't mess with\r
+               // other instances of mouse\r
                mouseDestroy: function() {\r
                        this.element.unbind('.mouse');\r
                        \r
                },\r
                \r
                mouseDown: function(e) {\r
-                       \r
                        // we may have missed mouseup (out of window)\r
-                       (this._mouseStarted\r
-                               && this.mouseUp(e));\r
+                       (this._mouseStarted && this.mouseUp(e));\r
                        \r
                        this._mouseDownEvent = e;\r
                        \r
                                return true;\r
                        }\r
                        \r
-                       this._mouseDelayMet = (this.options.delay == 0);\r
+                       this._mouseDelayMet = !this.options.delay;\r
                        if (!this._mouseDelayMet) {\r
                                this._mouseDelayTimer = setTimeout(function() {\r
                                        self._mouseDelayMet = true;\r
                        // these delegates are required to keep context\r
                        this._mouseMoveDelegate = function(e) {\r
                                return self.mouseMove(e);\r
-                       }\r
+                       };\r
                        this._mouseUpDelegate = function(e) {\r
                                return self.mouseUp(e);\r
-                       }\r
+                       };\r
                        $(document)\r
                                .bind('mousemove.mouse', this._mouseMoveDelegate)\r
                                .bind('mouseup.mouse', this._mouseUpDelegate);\r
                },\r
                \r
                mouseMove: function(e) {\r
-                       \r
                        // IE mouseup check - mouseup happened when mouse was out of window\r
                        if ($.browser.msie && !e.button) {\r
                                return this.mouseUp(e);\r
                },\r
                \r
                mouseUp: function(e) {\r
-                       \r
                        $(document)\r
                                .unbind('mousemove.mouse', this._mouseMoveDelegate)\r
                                .unbind('mouseup.mouse', this._mouseUpDelegate);\r