diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-25 00:56:10 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-25 00:56:10 +0000 |
commit | cdcd8bf37754fb697a06157ab95029440cba9b0c (patch) | |
tree | b1bff0b540c5acb2bfb736b4f2d6c61f709044fe /modules/comment/js | |
parent | d62acf041f9a880f1762c5a29e8b11133b651ff5 (diff) |
Update the form first, then clear it on success (else it doesn't get cleared on success)
Diffstat (limited to 'modules/comment/js')
-rw-r--r-- | modules/comment/js/comment.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js index d251ac96..7af70047 100644 --- a/modules/comment/js/comment.js +++ b/modules/comment/js/comment.js @@ -6,6 +6,8 @@ function ajaxify_comment_form() { $("#gComments form").ajaxForm({ dataType: 'json', success: function(data) { + $("#gComments form").replaceWith(data.form); + ajaxify_comment_form(); if (data.result == "success") { $.get(data.resource, function(data, textStatus) { $("#gComments .gBlockContent ul:first").append("<li>"+data+"</li>"); @@ -13,8 +15,6 @@ function ajaxify_comment_form() { }); $("#gComments form").clearForm(); } - $("#gComments form").replaceWith(data.form); - ajaxify_comment_form(); } }); }; |