Skip to content
Permalink
Browse files

Resizable: Use .insertAfter() instead of .after() to avoid recursivel…

…y destroying. Fixes #8662 - Infinite loop - new to jQuery UI 1.9.0.
  • Loading branch information...
scottgonzalez committed Oct 13, 2012
1 parent bd3a348 commit 025266e00270d155f45550b6838ddd6f4a44470b
Showing with 8 additions and 9 deletions.
  1. +8 −9 ui/jquery.ui.resizable.js
@@ -204,15 +204,14 @@ $.widget("ui.resizable", $.ui.mouse, {
if (this.elementIsWrapper) {
_destroy(this.element);
var wrapper = this.element;
wrapper.after(
this.originalElement.css({
position: wrapper.css('position'),
width: wrapper.outerWidth(),
height: wrapper.outerHeight(),
top: wrapper.css('top'),
left: wrapper.css('left')
})
).remove();
this.originalElement.css({
position: wrapper.css('position'),
width: wrapper.outerWidth(),
height: wrapper.outerHeight(),
top: wrapper.css('top'),
left: wrapper.css('left')
}).insertAfter( wrapper );
wrapper.remove();
}

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

2 comments on commit 025266e

@dmethvin

This comment has been minimized.

Copy link
Member

replied Oct 14, 2012

I just can't repro this when the two elements are connected. I see a bug for .after() with disconnected nodes but it shouldn't come into play with this code. Do you have a test case?

@scottgonzalez

This comment has been minimized.

Copy link
Member Author

replied Oct 14, 2012

Check the ticket for a link to the fiddle. The destroy is being auto-triggered by a call to .remove(), so it's likely that the elements are already disconnected.

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