diff --git a/app/helpers/stream_helper.rb b/app/helpers/stream_helper.rb index 3e239807f..3f67e7650 100644 --- a/app/helpers/stream_helper.rb +++ b/app/helpers/stream_helper.rb @@ -7,7 +7,7 @@ module StreamHelper def comment_toggle(count) if count == 0 link_to "#{t('comments.new_comment.comment').downcase}", '#', :class => "show_post_comments" - elsif count < 3 + elsif count <= 3 link_to "#{t('stream_helper.hide_comments')} (#{count})", '#', :class => "show_post_comments" else link_to "#{t('stream_helper.show_comments')} (#{count})", '#', :class => "show_post_comments" diff --git a/public/javascripts/web-socket-receiver.js b/public/javascripts/web-socket-receiver.js index e6b1b7983..d0d74dd38 100644 --- a/public/javascripts/web-socket-receiver.js +++ b/public/javascripts/web-socket-receiver.js @@ -75,7 +75,7 @@ processPerson: function(response){ if(toggler.length > 0){ toggler.html( - toggler.html().replace(/\d+/,$('.comments', post)[0].childElementCount -1) + toggler.html().replace(/\d+/,$('.comments', post).find('li').length -1) ); if( !$(".comments", post).is(':visible') ){