diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-26 04:09:03 +0000 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-26 04:09:03 +0000 |
| commit | 75d98701ae64100a0e444a0caaa14efbc1b2028d (patch) | |
| tree | 0b33117e8921216f23fbd8fd4a232a1fc8c95d38 | |
| parent | 96df4419f4827bc711623e8083dbafbdc3ab477c (diff) | |
Guard the calling of the form closing event so its not called if there
is no form.
| -rw-r--r-- | lib/gallery.dialog.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js index 6ff06d39..72c7cdf8 100644 --- a/lib/gallery.dialog.js +++ b/lib/gallery.dialog.js @@ -116,7 +116,10 @@ function on_form_loaded() { } function closeDialog() { - $("#gDialog").dialog("option", "form").trigger("form_closing"); + var form = $("#gDialog").dialog("option", "form"); + if (form != null) { + $("#gDialog").dialog("option", "form").trigger("form_closing"); + } $("#gDialog").dialog("destroy").remove(); } |
