From cdcd8bf37754fb697a06157ab95029440cba9b0c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 25 Dec 2008 00:56:10 +0000 Subject: Update the form first, then clear it on success (else it doesn't get cleared on success) --- modules/comment/js/comment.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/comment/js/comment.js') 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("
  • "+data+"
  • "); @@ -13,8 +15,6 @@ function ajaxify_comment_form() { }); $("#gComments form").clearForm(); } - $("#gComments form").replaceWith(data.form); - ajaxify_comment_form(); } }); }; -- cgit v1.2.3