diff options
author | csarven <csarven@controlyourself.ca> | 2008-12-08 00:58:12 -0500 |
---|---|---|
committer | csarven <csarven@controlyourself.ca> | 2008-12-08 00:58:12 -0500 |
commit | 665a3325b38d18dcfe6eb4ba1c693b2ed9578210 (patch) | |
tree | 4c25fc416e8bab5a8e42f0db858d7b92df8ff973 /js | |
parent | 71c8d903785ada852408919a38161024c7e06cb7 (diff) |
Nudge disabled and greyed out while ajaxForm process
darcs-hash:20081208055812-eefa4-719bb1b630a7d0764b286d67488313627b5180c8.gz
Diffstat (limited to 'js')
-rw-r--r-- | js/util.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/js/util.js b/js/util.js index 592a563c3..c68bc9b5c 100644 --- a/js/util.js +++ b/js/util.js @@ -87,7 +87,13 @@ $(document).ready(function(){ $("form.disfavor").each(addAjaxHidden); $("#nudge").ajaxForm ({ dataType: 'xml', - success: function(xml) { $("#nudge").replaceWith(document._importNode($("#nudge_response", xml).get(0),true)); } + beforeSubmit: function(xml) { $("form#nudge input[type=submit]").attr("disabled", "disabled"); + $("form#nudge input[type=submit]").addClass("disabled"); + }, + success: function(xml) { $("#nudge").replaceWith(document._importNode($("#nudge_response", xml).get(0),true)); + $("#nudge input[type=submit]").removeAttr("disabled"); + $("#nudge input[type=submit]").removeClass("disabled"); + } }); $("#nudge").each(addAjaxHidden); $("#nudge .submit").bind('click', function(e) { $(this).addClass("processing"); }); |