]> source.dussan.org Git - jquery-ui.git/commitdiff
Dialog: Don't try to place the dialog next to itself on destroy. Fixes #8613 - Destro...
authorScott González <scott.gonzalez@gmail.com>
Mon, 1 Oct 2012 19:34:44 +0000 (15:34 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 1 Oct 2012 19:34:44 +0000 (15:34 -0400)
ui/jquery.ui.dialog.js

index bcbb68c5a75dda8a292b61be7c261f0fd09b9e8e..77424047cdef6c3e026d88ddcf2e3d854c3289a1 100644 (file)
@@ -216,7 +216,8 @@ $.widget("ui.dialog", {
                }
 
                next = oldPosition.parent.children().eq( oldPosition.index );
-               if ( next.length ) {
+               // Don't try to place the dialog next to itself (#8613)
+               if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
                        next.before( this.element );
                } else {
                        oldPosition.parent.append( this.element );