diff --git a/r2/r2/public/static/js/jquery.reddit.js b/r2/r2/public/static/js/jquery.reddit.js index d18305beb..1090a2356 100644 --- a/r2/r2/public/static/js/jquery.reddit.js +++ b/r2/r2/public/static/js/jquery.reddit.js @@ -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); diff --git a/r2/r2/public/static/js/reddit.js b/r2/r2/public/static/js/reddit.js index fa8a657af..c6c5a1f52 100644 --- a/r2/r2/public/static/js/reddit.js +++ b/r2/r2/public/static/js/reddit.js @@ -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; };