mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Merge pull request #3 from scottgonzalez/interactions
Draggable: Use ._bind().
This commit is contained in:
commit
1cb5b87589
16
ui/jquery.ui.draggable.js
vendored
16
ui/jquery.ui.draggable.js
vendored
@ -45,8 +45,7 @@ $.widget( "ui.draggable", {
|
|||||||
this.element.css( "position", "relative" );
|
this.element.css( "position", "relative" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: use _bind()
|
this._bind({ mousedown: "_mouseDown" });
|
||||||
this.element.bind( "mousedown." + this.widgetName, $.proxy( this, "_mouseDown" ) );
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: why is relative handled differently than fixed/absolute?
|
// TODO: why is relative handled differently than fixed/absolute?
|
||||||
@ -133,11 +132,10 @@ $.widget( "ui.draggable", {
|
|||||||
// TODO: allow modifying position, just like during drag
|
// TODO: allow modifying position, just like during drag
|
||||||
this._trigger( "start", event, this._uiHash() );
|
this._trigger( "start", event, this._uiHash() );
|
||||||
|
|
||||||
// TODO: use ._bind()
|
this._bind( this.doc, {
|
||||||
// TODO: rename _bind() to _on(); add _off()
|
mousemove: "_mouseMove",
|
||||||
this.doc
|
mouseup: "_mouseUp"
|
||||||
.bind( "mousemove." + this.widgetName, $.proxy( this, "_mouseMove" ) )
|
});
|
||||||
.bind( "mouseup." + this.widgetName, $.proxy( this, "_mouseUp" ) );
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_mouseMove: function( event ) {
|
_mouseMove: function( event ) {
|
||||||
@ -205,9 +203,7 @@ $.widget( "ui.draggable", {
|
|||||||
this.dragEl.remove();
|
this.dragEl.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.doc
|
this.doc.unbind( "." + this.widgetName );
|
||||||
.unbind( "mousemove." + this.widgetName )
|
|
||||||
.unbind( "mouseup." + this.widgetName );
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_uiHash: function( event ) {
|
_uiHash: function( event ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user