@@ -45,8 +45,7 @@ $.widget( "ui.draggable", {
45
45
this . element . css ( "position" , "relative" ) ;
46
46
}
47
47
48
- // TODO: use _bind()
49
- this . element . bind ( "mousedown." + this . widgetName , $ . proxy ( this , "_mouseDown" ) ) ;
48
+ this . _bind ( { mousedown : "_mouseDown" } ) ;
50
49
} ,
51
50
52
51
// TODO: why is relative handled differently than fixed/absolute?
@@ -133,11 +132,10 @@ $.widget( "ui.draggable", {
133
132
// TODO: allow modifying position, just like during drag
134
133
this . _trigger ( "start" , event , this . _uiHash ( ) ) ;
135
134
136
- // TODO: use ._bind()
137
- // TODO: rename _bind() to _on(); add _off()
138
- this . doc
139
- . bind ( "mousemove." + this . widgetName , $ . proxy ( this , "_mouseMove" ) )
140
- . bind ( "mouseup." + this . widgetName , $ . proxy ( this , "_mouseUp" ) ) ;
135
+ this . _bind ( this . doc , {
136
+ mousemove : "_mouseMove" ,
137
+ mouseup : "_mouseUp"
138
+ } ) ;
141
139
} ,
142
140
143
141
_mouseMove : function ( event ) {
@@ -205,9 +203,7 @@ $.widget( "ui.draggable", {
205
203
this . dragEl . remove ( ) ;
206
204
}
207
205
208
- this . doc
209
- . unbind ( "mousemove." + this . widgetName )
210
- . unbind ( "mouseup." + this . widgetName ) ;
206
+ this . doc . unbind ( "." + this . widgetName ) ;
211
207
} ,
212
208
213
209
_uiHash : function ( event ) {
0 commit comments