update js to prevent duplicate form submissions

This commit is contained in:
spez
2009-03-02 15:50:57 -08:00
parent f6fbb05a79
commit 63ddf2b608
2 changed files with 5 additions and 3 deletions

View File

@@ -130,6 +130,8 @@ $.request = function(op, parameters, worker_in, block) {
parameters = $.with_default(parameters, {});
worker_in = $.with_default(worker_in, handleResponse(action));
if (typeof(worker_in) != 'function')
worker_in = handleResponse(action);
var worker = function(r) {
release_ajax_lock(action);
return worker_in(r);

View File

@@ -47,13 +47,13 @@ function post_form(form, where, statusfunc, nametransformfunc, block) {
/* set the submitted state */
$(form).find(".error").not(".status").hide();
$(form).find(".status").html(statusfunc(form)).show();
return simple_post_form(form, where, {});
return simple_post_form(form, where, {}, block);
} catch(e) {
return false;
}
};
function simple_post_form(form, where, fields) {
function simple_post_form(form, where, fields, block) {
fields = fields || {};
/* consolidate the form's inputs for submission */
$(form).find("select, input, textarea").not(".gray").each(function() {
@@ -66,7 +66,7 @@ function simple_post_form(form, where, fields) {
fields.id = $(form).attr("id") ? ("#" + $(form).attr("id")) : "";
}
$.request(where, fields);
$.request(where, fields, null, block);
return false;
};