diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index 55237f7..c17fea8 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -100,9 +100,9 @@ class ContentViewerController < ApplicationController end @comments = @page.comments.without_spam + @comments = @plugins.filter(:unavailable_comments, @comments) @comments_count = @comments.count - @comments = @plugins.filter(:unavailable_comments, @comments.without_reply) - @comments = @comments.paginate(:per_page => per_page, :page => params[:comment_page] ) + @comments = @comments.without_reply.paginate(:per_page => per_page, :page => params[:comment_page] ) if params[:slideshow] render :action => 'slideshow', :layout => 'slideshow' diff --git a/public/javascripts/comment_form.js b/public/javascripts/comment_form.js index 2b63562..c49f40b 100644 --- a/public/javascripts/comment_form.js +++ b/public/javascripts/comment_form.js @@ -54,7 +54,7 @@ function save_comment(button) { $('#'+ data.render_target).replaceWith(data.html); $('#' + data.render_target).effect("highlight", {}, 3000); $.colorbox.close(); - update_comment_count(); + increment_comment_count(comment_div); } else { //New comment of article comment_div.find('.article-comments-list').append(data.html); @@ -65,9 +65,10 @@ function save_comment(button) { page_comment_form.find('.errorExplanation').remove(); $.colorbox.close(); - update_comment_count(); + increment_comment_count(comment_div); } + if(jQuery('#recaptcha_response_field').val()){ Recaptcha.reload(); } @@ -83,12 +84,11 @@ function save_comment(button) { }, 'json'); } -function update_comment_count() { +function increment_comment_count(comment_div) { comment_div.find('.comment-count').add('#article-header .comment-count').each(function() { - var count = parseInt($(this).html()); - update_comment_count($(this), count + 1); + var count = parseInt(jQuery(this).html()); + update_comment_count(jQuery(this), count + 1); }); - } function show_display_comment_button() { -- libgit2 0.21.2