summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-12-11 20:47:09 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-12-11 20:47:09 +0000
commitbf10544e27a8c942e6907d059586119b80112337 (patch)
treeaa0eebfdc37462908dfd099bc82329fdbfe20c2b
parentfaeb52e7f4d7a16242c9a7c1674cb1798058d179 (diff)
Destroy the popup dialog when it closes so there is nothing hanging around and we can reuse it for a different popup
-rw-r--r--themes/default/js/ui.init.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/themes/default/js/ui.init.js b/themes/default/js/ui.init.js
index a131421b..9ba4a642 100644
--- a/themes/default/js/ui.init.js
+++ b/themes/default/js/ui.init.js
@@ -69,6 +69,7 @@ function handleDialogEvent(event) {
function openDialog(element) {
var href = $(element).attr("href");
var dialog = '<div id="gDialog"></div>';
+
$("body").append(dialog);
$("#gDialog").dialog({
draggable: true,
@@ -78,6 +79,10 @@ function openDialog(element) {
opacity: 0.7,
background: "black"
},
+ close: function (event, ui) {
+ $("#gDialog").dialog('destroy').remove();
+ },
+
resizable: true,
title: $(element).attr("title"),
width: '500px'