mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Draggable: Fixed backCompat
for appendTo
when no helper exists
This commit is contained in:
parent
9990013f33
commit
d32183edc4
10
ui/jquery.ui.draggable.js
vendored
10
ui/jquery.ui.draggable.js
vendored
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user