Skip to content

Commit 7c419a7

Browse files
committed
Mouse: Remove core event/alias and deprecated module dependencies
1 parent 456c463 commit 7c419a7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ui/mouse.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
}(function( $ ) {
2929

3030
var mouseHandled = false;
31-
$( document ).mouseup( function() {
31+
$( document ).on( "mouseup", function() {
3232
mouseHandled = false;
3333
});
3434

@@ -43,10 +43,10 @@ return $.widget("ui.mouse", {
4343
var that = this;
4444

4545
this.element
46-
.bind("mousedown." + this.widgetName, function(event) {
46+
.on("mousedown." + this.widgetName, function(event) {
4747
return that._mouseDown(event);
4848
})
49-
.bind("click." + this.widgetName, function(event) {
49+
.on("click." + this.widgetName, function(event) {
5050
if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
5151
$.removeData(event.target, that.widgetName + ".preventClickEvent");
5252
event.stopImmediatePropagation();
@@ -60,11 +60,11 @@ return $.widget("ui.mouse", {
6060
// TODO: make sure destroying one instance of mouse doesn't mess with
6161
// other instances of mouse
6262
_mouseDestroy: function() {
63-
this.element.unbind("." + this.widgetName);
63+
this.element.off("." + this.widgetName);
6464
if ( this._mouseMoveDelegate ) {
6565
this.document
66-
.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
67-
.unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
66+
.off("mousemove." + this.widgetName, this._mouseMoveDelegate)
67+
.off("mouseup." + this.widgetName, this._mouseUpDelegate);
6868
}
6969
},
7070

@@ -119,8 +119,8 @@ return $.widget("ui.mouse", {
119119
};
120120

121121
this.document
122-
.bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
123-
.bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
122+
.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
123+
.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
124124

125125
event.preventDefault();
126126

@@ -164,8 +164,8 @@ return $.widget("ui.mouse", {
164164

165165
_mouseUp: function(event) {
166166
this.document
167-
.unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
168-
.unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
167+
.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
168+
.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
169169

170170
if (this._mouseStarted) {
171171
this._mouseStarted = false;

0 commit comments

Comments
 (0)