mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Draggable: Added helper to the draggable data while it exists
This commit is contained in:
parent
bc5bbd0763
commit
1e58ab22ff
3
ui/jquery.ui.draggable.js
vendored
3
ui/jquery.ui.draggable.js
vendored
@ -199,6 +199,7 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
||||
// If user cancels stop, leave helper there
|
||||
if ( this._trigger( "stop", event, this._fullHash( pointerPosition ) ) !== false ) {
|
||||
if ( this.options.helper ) {
|
||||
delete this.element.data( 'draggable' ).helper;
|
||||
this.dragEl.remove();
|
||||
}
|
||||
this._resetDomPosition();
|
||||
@ -232,6 +233,8 @@ $.widget( "ui.draggable", $.ui.interaction, {
|
||||
helper.appendTo( this._appendToEl() || this.document[0].body );
|
||||
}
|
||||
|
||||
this.element.data( 'draggable' ).helper = helper;
|
||||
|
||||
return helper
|
||||
// Helper must be absolute to function properly
|
||||
.css( "position", "absolute" )
|
||||
|
Loading…
Reference in New Issue
Block a user