js: destroy dialog when closed

This commit is contained in:
Benjamin Dauvergne 2014-08-14 10:25:23 +02:00
parent 6ac05bf6cc
commit a075ca07c9
1 changed files with 8 additions and 1 deletions

View File

@ -79,7 +79,14 @@ function displayPopup(event)
/* get title out of html */
var title = $html.find(title_selector).text();
$form.dialog({modal: true, 'title': title, width: 'auto'});
$form.dialog({
modal: true,
'title': title,
width: 'auto',
close: function (ev, ui) {
$(this).dialog('destroy');
},
});
/* if the form doesn't have an @action attribute, set it to URL */
if (! $form.prop('action')) {