Skip to content
Permalink
Browse files

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
  • Loading branch information
rdworth committed Feb 3, 2010
1 parent 30578eb commit ec5e7ad95ba4c6697f3e66ae93ffc86c1152aefb
Showing with 33 additions and 2 deletions.
  1. +31 −0 tests/visual/resizable/resizable_ticket_4940.html
  2. +2 −2 ui/jquery.ui.resizable.js
@@ -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>
@@ -204,15 +204,15 @@ $.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(),
height: wrapper.outerHeight(),
top: wrapper.css('top'),
left: wrapper.css('left')
})
).end().remove();
).remove();
}

this.originalElement.css('resize', this.originalResizeStyle);

0 comments on commit ec5e7ad

Please sign in to comment.
You can’t perform that action at this time.