summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-24 17:30:06 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-24 17:30:06 +0000
commit520a4b41b3776c0ffb71af5580668d6530d9ed05 (patch)
tree41fd32cadf30684db1b83119c1d49360a83e1b54
parentfd58fe0ae02d14fca16b9bd2e7f664c016a494c7 (diff)
Add a "form_closing" custom event to the dialog processing. This
allows the form in the dialog todo custom processing when the form closes. For example, the server_add dialog (next commit) uses this callback to determine if the upload task was cancelled and display a warning message when the page reloads. Usage: $("#gServerAdd form").bind("form_closing", function(target){...});
-rw-r--r--lib/gallery.dialog.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 7f2de843..6ff06d39 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -104,17 +104,19 @@ function on_form_loaded() {
$("#gDialog .submit").addClass("ui-state-default ui-corner-all");
$("#gDialog .submit").parent().append(eCancel);
}
+ $("#gDialog").dialog("option", "form", $("#gDialog form"));
$("#gDialog .ui-state-default").hover(
- function(){
+ function() {
$(this).addClass("ui-state-hover");
},
- function(){
+ function() {
$(this).removeClass("ui-state-hover");
}
);
}
function closeDialog() {
+ $("#gDialog").dialog("option", "form").trigger("form_closing");
$("#gDialog").dialog("destroy").remove();
}