Comment sets now pop open on receiving a new comment

This commit is contained in:
Raphael 2010-08-25 18:00:53 -07:00
parent 50459d896c
commit e714e0d457
2 changed files with 6 additions and 2 deletions

View file

@ -48,6 +48,10 @@
toggler = $('.show_post_comments', post)
toggler.html(
toggler.html().replace(/\d/,$('.comment_set', post)[0].childElementCount -1));
if( !$(".comments", post).is(':visible') ){
toggler.click();
}
}
function processPost(className, html, groupIds){

View file

@ -1,10 +1,10 @@
$(document).ready(function(){
$('.comment_set').each(function(index) {
var $this = $(this);
if($this.children().length > 1) {
$this.parent().show();
var show_comments_toggle = $this.parent().prev().children(".show_post_comments");
show_comments_toggle.html("hide comments ("+ ($this.children().length - 1) + ")");
show_comments_toggle.click();
};
});
});//end document ready