Draggable: Added helper to the draggable data while it exists

This commit is contained in:
Dave Stein 2012-12-21 17:53:40 -05:00
parent bc5bbd0763
commit 1e58ab22ff

View File

@ -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" )