Draggable: Fixed backCompat for appendTo when no helper exists

This commit is contained in:
Dave Stein 2013-02-24 18:47:24 -05:00
parent 9990013f33
commit d32183edc4

View File

@ -91,6 +91,8 @@ $.widget( "ui.draggable", $.ui.interaction, {
this._createHelper( pointerPosition ) :
this.element;
// _createHelper() ensures that helpers are in the correct position
// in the DOM, but we need to handle appendTo when there is no helper
if ( this.options.appendTo && this.dragEl === this.element ) {
@ -564,11 +566,17 @@ if ( $.uiBackCompat !== false ) {
// appendTo 'parent' value
$.widget( "ui.draggable", $.ui.draggable, {
// Helper passed in since _createHelper calls this before dragEl is set
_appendToEl: function() {
var el = this.options.appendTo;
if ( el === "parent" || el === null ) {
// This should only happen via _createHelper
if ( el === null ) {
return this.element.parent();
}
if ( el === "parent" ) {
el = this.dragEl.parent();
}