28
28
} ( function ( $ ) {
29
29
30
30
var mouseHandled = false ;
31
- $ ( document ) . mouseup ( function ( ) {
31
+ $ ( document ) . on ( "mouseup" , function ( ) {
32
32
mouseHandled = false ;
33
33
} ) ;
34
34
@@ -43,10 +43,10 @@ return $.widget("ui.mouse", {
43
43
var that = this ;
44
44
45
45
this . element
46
- . bind ( "mousedown." + this . widgetName , function ( event ) {
46
+ . on ( "mousedown." + this . widgetName , function ( event ) {
47
47
return that . _mouseDown ( event ) ;
48
48
} )
49
- . bind ( "click." + this . widgetName , function ( event ) {
49
+ . on ( "click." + this . widgetName , function ( event ) {
50
50
if ( true === $ . data ( event . target , that . widgetName + ".preventClickEvent" ) ) {
51
51
$ . removeData ( event . target , that . widgetName + ".preventClickEvent" ) ;
52
52
event . stopImmediatePropagation ( ) ;
@@ -60,11 +60,11 @@ return $.widget("ui.mouse", {
60
60
// TODO: make sure destroying one instance of mouse doesn't mess with
61
61
// other instances of mouse
62
62
_mouseDestroy : function ( ) {
63
- this . element . unbind ( "." + this . widgetName ) ;
63
+ this . element . off ( "." + this . widgetName ) ;
64
64
if ( this . _mouseMoveDelegate ) {
65
65
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 ) ;
68
68
}
69
69
} ,
70
70
@@ -119,8 +119,8 @@ return $.widget("ui.mouse", {
119
119
} ;
120
120
121
121
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 ) ;
124
124
125
125
event . preventDefault ( ) ;
126
126
@@ -164,8 +164,8 @@ return $.widget("ui.mouse", {
164
164
165
165
_mouseUp : function ( event ) {
166
166
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 ) ;
169
169
170
170
if ( this . _mouseStarted ) {
171
171
this . _mouseStarted = false ;
0 commit comments