summaryrefslogtreecommitdiff
path: root/modules/comment/js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-04 11:42:37 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-04 11:42:37 -0800
commit8ca69cffbba70fe22e19478f742a37bdbd758d83 (patch)
tree712a69eef7d134d7ad2ea2668d30fda44914beff /modules/comment/js
parent5743b159c28888f2165cc4269d3302fea24fde7a (diff)
parent5c107be9033ae48f781c8430702458f613e791ee (diff)
Merge branch 'master' into talmdal_dev
Diffstat (limited to 'modules/comment/js')
-rw-r--r--modules/comment/js/comment.js21
1 files changed, 10 insertions, 11 deletions
diff --git a/modules/comment/js/comment.js b/modules/comment/js/comment.js
index 3f058062..bb204b78 100644
--- a/modules/comment/js/comment.js
+++ b/modules/comment/js/comment.js
@@ -28,17 +28,16 @@ function ajaxify_comment_form() {
$("#g-comments form").ajaxForm({
dataType: "json",
success: function(data) {
- if (data.form) {
- $("#g-comments form").replaceWith(data.form);
- ajaxify_comment_form();
- }
- if (data.result == "success" && data.resource) {
- $.get(data.resource, function(data, textStatus) {
- $("#g-comments .g-block-content ul:first").append("<li>"+data+"</li>");
- $("#g-comments .g-block-content ul:first li:last").effect("highlight", {color: "#cfc"}, 8000);
- $("#g-comment-form").hide(2000).remove();
- $("#g-no-comments-yet").hide(2000);
- });
+ if (data.result == "success") {
+ $("#g-comments #g-comment-detail ul").append(data.view);
+ $("#g-comments #g-comment-detail ul li:last").effect("highlight", {color: "#cfc"}, 8000);
+ $("#g-comment-form").hide(2000).remove();
+ $("#g-no-comments-yet").hide(2000);
+ } else {
+ if (data.form) {
+ $("#g-comments form").replaceWith(data.form);
+ ajaxify_comment_form();
+ }
}
}
});