diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/mouse.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ui/mouse.js b/ui/mouse.js index ed898f2a9..f9c259552 100644 --- a/ui/mouse.js +++ b/ui/mouse.js @@ -28,7 +28,7 @@ }(function( $ ) { var mouseHandled = false; -$( document ).mouseup( function() { +$( document ).on( "mouseup", function() { mouseHandled = false; }); @@ -43,10 +43,10 @@ return $.widget("ui.mouse", { var that = this; this.element - .bind("mousedown." + this.widgetName, function(event) { + .on("mousedown." + this.widgetName, function(event) { return that._mouseDown(event); }) - .bind("click." + this.widgetName, function(event) { + .on("click." + this.widgetName, function(event) { if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) { $.removeData(event.target, that.widgetName + ".preventClickEvent"); event.stopImmediatePropagation(); @@ -60,11 +60,11 @@ return $.widget("ui.mouse", { // TODO: make sure destroying one instance of mouse doesn't mess with // other instances of mouse _mouseDestroy: function() { - this.element.unbind("." + this.widgetName); + this.element.off("." + this.widgetName); if ( this._mouseMoveDelegate ) { this.document - .unbind("mousemove." + this.widgetName, this._mouseMoveDelegate) - .unbind("mouseup." + this.widgetName, this._mouseUpDelegate); + .off("mousemove." + this.widgetName, this._mouseMoveDelegate) + .off("mouseup." + this.widgetName, this._mouseUpDelegate); } }, @@ -119,8 +119,8 @@ return $.widget("ui.mouse", { }; this.document - .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); + .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); event.preventDefault(); @@ -164,8 +164,8 @@ return $.widget("ui.mouse", { _mouseUp: function(event) { this.document - .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) - .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); + .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); if (this._mouseStarted) { this._mouseStarted = false; |