]> source.dussan.org Git - jquery-ui.git/commitdiff
resizable method destroy: put unwrapped original element in wrapper's place instead...
authorRichard Worth <rdworth@gmail.com>
Wed, 3 Feb 2010 01:22:02 +0000 (01:22 +0000)
committerRichard Worth <rdworth@gmail.com>
Wed, 3 Feb 2010 01:22:02 +0000 (01:22 +0000)
tests/visual/resizable/resizable_ticket_4940.html [new file with mode: 0644]
ui/jquery.ui.resizable.js

diff --git a/tests/visual/resizable/resizable_ticket_4940.html b/tests/visual/resizable/resizable_ticket_4940.html
new file mode 100644 (file)
index 0000000..111ce7e
--- /dev/null
@@ -0,0 +1,31 @@
+<!doctype html>
+<html lang="en">
+<head>
+       <title>Resizable Visual Test : Resizable ticket #4940</title>
+       <link rel="stylesheet" href="../visual.css" type="text/css" />
+       <link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css" />
+       <script type="text/javascript" src="../../../jquery-1.4.1.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.mouse.js"></script>
+       <script type="text/javascript" src="../../../ui/jquery.ui.resizable.js"></script>
+       <script type="text/javascript">
+       $(function() {
+               $("#resizable").resizable().resizable('destroy');
+       });
+       </script>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a href="http://dev.jqueryui.com/ticket/4940">#4940 - resizable('destroy') moves images to end of parent element</a></h1>
+
+before
+
+<textarea id="resizable"></textarea>
+
+after
+
+</div>
+
+</body>
+</html>
index e6728674b3855ef28fab97547e5828c91a2f8754..3512b49be92bc094efc8fe3d24db69ae210c213a 100644 (file)
@@ -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);