From e73d019dffe19e6b8a7b0659d8da4293ae3ea3ae Mon Sep 17 00:00:00 2001 From: Eduardo Lundgren Date: Sun, 29 Jun 2008 14:34:14 +0000 Subject: [PATCH] Sortable - fixed #3048 --- ui/ui.sortable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index 17ee71281..52779026f 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -332,7 +332,7 @@ $.widget("ui.sortable", $.extend($.ui.mouse, { //Create and append the visible helper this.helper = typeof o.helper == 'function' ? $(o.helper.apply(this.element[0], [e, this.currentItem])) : this.currentItem.clone(); - if(!this.helper.parents('body').length) this.helper.appendTo((o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)); //Add the helper to the DOM if that didn't happen already + if (!this.helper.parents('body').length) $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(this.helper[0]); //Add the helper to the DOM if that didn't happen already this.helper.css({ position: 'absolute', clear: 'both' }).addClass('ui-sortable-helper'); //Position it absolutely and add a helper class /* @@ -533,7 +533,7 @@ $.widget("ui.sortable", $.extend($.ui.mouse, { }, rearrange: function(e, i, a, hardRefresh) { - a ? a.append(this.currentItem) : i.item[this.direction == 'down' ? 'before' : 'after'](this.currentItem); + a ? a[0].appendChild(this.currentItem[0]) : i.item[0].parentNode.insertBefore(this.currentItem[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling)); //Various things done here to improve the performance: // 1. we create a setTimeout, that calls refreshPositions