summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-23 13:08:10 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-23 13:08:10 -0700
commit6af697686ae10620f084559d366d0e658300c1b3 (patch)
tree7457892cffd98ace481f4cd62748b3892ace211c
parentaa85d27eab10b47f7c7cfc5bfeb26f41baed8753 (diff)
Put logic into gallery.dialog.js so that when the form is submitted, the submit button is disabled and the user is no longer able to submit multiple clicks. This should fix tickets: #623, #790, #799
-rw-r--r--lib/gallery.dialog.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gallery.dialog.js b/lib/gallery.dialog.js
index 89470519..a3715929 100644
--- a/lib/gallery.dialog.js
+++ b/lib/gallery.dialog.js
@@ -106,6 +106,12 @@
var self = this;
$("#g-dialog form").ajaxForm({
dataType: "json",
+ beforeSubmit: function(formData, form, options) {
+ form.find(":submit")
+ .addClass("ui-state-disabled")
+ .attr("disabled", "disabled");
+ return true;
+ },
success: function(data) {
if (data.form) {
$("#g-dialog form").replaceWith(data.form);