jquery/jquery-ui — pull request #925 by romaninsh (2013-02-24 19:32:42+00:00)
Title: Destroy dialog when original DOM parent is removed

When dialog is initialized inside a div which is then
being removed, dialog window remain open. In sophisticated
UI system this becomes problem, when dialog-based widgets
appear in other dialogs and remain after their parent-dialog
is removed.

Here is demo and alternative solution:
http://jsfiddle.net/gxXBY/

However this pull request would resolve issue