diff options
Diffstat (limited to 'themes/default/js/comment.js')
-rw-r--r-- | themes/default/js/comment.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/themes/default/js/comment.js b/themes/default/js/comment.js new file mode 100644 index 00000000..5d2ed599 --- /dev/null +++ b/themes/default/js/comment.js @@ -0,0 +1,20 @@ +$("document").ready(function() { + ajaxify_comment_form(); +}); + +function ajaxify_comment_form() { + $("#gCommentForm").ajaxForm({ + target: "#gCommentForm", + complete: function(xhr, statusText) { + ajaxify_comment_form(); + if (xhr.status == 201) { + $.get(xhr.getResponseHeader("Location"), function(data, textStatus) { + $("#gComment div.gBlockContent ul:first").append(data); + $("#gComment div.gBlockContent ul:first li:last").hide().slideDown(); + } + ); + $("#gCommentForm").clearForm(); + } + } + }); +} |