]> source.dussan.org Git - jquery-ui.git/commitdiff
Sortable: Changed to check the parent's length so that the dom position of the remove...
authorkborchers <k_borchers@yahoo.com>
Mon, 16 May 2011 21:25:03 +0000 (16:25 -0500)
committerScott González <scott.gonzalez@gmail.com>
Wed, 25 May 2011 20:13:00 +0000 (16:13 -0400)
(cherry picked from commit 8e8a7b015f4f5a76c187dfca9af7519ae356bb16)

ui/jquery.ui.sortable.js

index 91a42658f111cff9637cd67563a1f3d3f83f617c..c4814c2aa4a624b749c41b2c9b0d052082d68943 100644 (file)
@@ -984,7 +984,7 @@ $.widget("ui.sortable", $.ui.mouse, {
 
                // We first have to update the dom position of the actual currentItem
                // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
-               if(!this._noFinalSort && this.currentItem[0].parentNode) this.placeholder.before(this.currentItem);
+               if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
                this._noFinalSort = null;
 
                if(this.helper[0] == this.currentItem[0]) {