From: Richard Worth Date: Wed, 3 Feb 2010 01:22:02 +0000 (+0000) Subject: resizable method destroy: put unwrapped original element in wrapper's place instead... X-Git-Tag: 1.8rc2~28 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ec5e7ad95ba4c6697f3e66ae93ffc86c1152aefb;p=jquery-ui.git resizable method destroy: put unwrapped original element in wrapper's place instead of at the end of wrapper's parent. Fixes #4940 - resizable('destroy') moves images to end of parent element --- diff --git a/tests/visual/resizable/resizable_ticket_4940.html b/tests/visual/resizable/resizable_ticket_4940.html new file mode 100644 index 000000000..111ce7e77 --- /dev/null +++ b/tests/visual/resizable/resizable_ticket_4940.html @@ -0,0 +1,31 @@ + + + + Resizable Visual Test : Resizable ticket #4940 + + + + + + + + + + + +

#4940 - resizable('destroy') moves images to end of parent element

+ +before + + + +after + + + + + diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index e6728674b..3512b49be 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -204,7 +204,7 @@ $.widget("ui.resizable", $.ui.mouse, { if (this.elementIsWrapper) { _destroy(this.element); var wrapper = this.element; - wrapper.parent().append( + wrapper.after( this.originalElement.css({ position: wrapper.css('position'), width: wrapper.outerWidth(), @@ -212,7 +212,7 @@ $.widget("ui.resizable", $.ui.mouse, { top: wrapper.css('top'), left: wrapper.css('left') }) - ).end().remove(); + ).remove(); } this.originalElement.css('resize', this.originalResizeStyle);