]> source.dussan.org Git - jquery-ui.git/commitdiff
Mouse: Remove core event/alias and deprecated module dependencies
authorAlexander Schmitz <arschmitz@gmail.com>
Thu, 14 May 2015 02:11:56 +0000 (22:11 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Wed, 20 May 2015 18:27:57 +0000 (14:27 -0400)
ui/mouse.js

index ed898f2a90da7b87230e3277a05175b58796b065..f9c2595526d1674665df266de3a7e9467caefbde 100644 (file)
@@ -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;