summaryrefslogtreecommitdiff
path: root/lib/gallery.dialog.js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-07-09 10:40:22 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-07-09 11:10:02 -0700
commitf26d5dbbdf559ab78d2c2d02d11b4833c98a0040 (patch)
tree3da8cac85824ed3314a0aa4a5f6270eae89068b8 /lib/gallery.dialog.js
parent591c5a11a396c6611a1e40f3c10253c5cfd78434 (diff)
Reset the title in case the dialog contents changed the dialog title.
Diffstat (limited to 'lib/gallery.dialog.js')
-rw-r--r--lib/gallery.dialog.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 289345bc..1d0eae7e 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -37,15 +37,7 @@
self._layout();
$("#g-dialog").dialog("open");
- // Remove titlebar for progress dialogs or set title
- if ($("#g-dialog #g-progress").length) {
- $(".ui-dialog-titlebar").remove();
- } else if ($("#g-dialog h1").length) {
- $("#g-dialog").dialog('option', 'title', $("#g-dialog h1:eq(0)").html());
- $("#g-dialog h1:eq(0)").hide();
- } else if ($("#g-dialog fieldset legend").length) {
- $("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html());
- }
+ self._set_title();
if ($("#g-dialog form").length) {
self._ajaxify_dialog();
@@ -122,6 +114,7 @@
$("#g-dialog").dialog("option", "position", "center");
$("#g-dialog form :submit").removeClass("ui-state-disabled")
.attr("disabled", null);
+ self._set_title();
self._ajaxify_dialog();
self.form_loaded(null, $("#g-dialog form"));
if (typeof data.reset == 'function') {
@@ -139,6 +132,18 @@
});
},
+ _set_title: function() {
+ // Remove titlebar for progress dialogs or set title
+ if ($("#g-dialog #g-progress").length) {
+ $(".ui-dialog-titlebar").remove();
+ } else if ($("#g-dialog h1").length) {
+ $("#g-dialog").dialog('option', 'title', $("#g-dialog h1:eq(0)").html());
+ $("#g-dialog h1:eq(0)").hide();
+ } else if ($("#g-dialog fieldset legend").length) {
+ $("#g-dialog").dialog('option', 'title', $("#g-dialog fieldset legend:eq(0)").html());
+ }
+ },
+
form_closing: function(event, ui) {},
dialog_closing: function(event, ui) {}
});