empty message re-appears if all stream posts are deleted

This commit is contained in:
danielvincent 2010-10-14 15:40:34 -07:00
parent 8daf2d0fd5
commit 750b4b4388
3 changed files with 12 additions and 13 deletions

View file

@ -12,10 +12,9 @@
- for post in @posts - for post in @posts
= render type_partial(post), :post => post unless post.class == Album = render type_partial(post), :post => post unless post.class == Album
- if @posts.size == 0 #empty_message{:style => ("display:none" unless @posts.count == 0)}
#empty_message .null_arrow ⇧
.null_arrow ⇧ %h3 Nobody has said anything yet. Get the conversation started!
%h3 Nobody has said anything yet. Get the conversation started!
#pagination #pagination
= will_paginate @posts = will_paginate @posts

View file

@ -12,10 +12,9 @@
- for post in @posts - for post in @posts
= render type_partial(post), :post => post unless post.class == Album = render type_partial(post), :post => post unless post.class == Album
- if @posts.size == 0 #empty_message{:style => ("display:none" unless @posts.count == 0)}
#empty_message .null_arrow ⇧
.null_arrow ⇧ %h3 Nobody has said anything yet. Get the conversation started!
%h3 Nobody has said anything yet. Get the conversation started!
#pagination #pagination
= will_paginate @posts = will_paginate @posts

View file

@ -37,9 +37,10 @@
}); });
function processRetraction(post_id){ function processRetraction(post_id){
$('#' + post_id ).fadeOut(500, function(){ $('#' + post_id ).fadeOut(500).remove();
$(this).remove; if($("#stream")[0].childElementCount == 0){
}); $("#empty_message").fadeIn(200);
}
} }
function processComment(post_id, html){ function processComment(post_id, html){
@ -67,8 +68,8 @@
) )
}; };
if( $("#empty_message").length > 0 ){ if( $("#empty_message").is(":visible") ){
$("#empty_message").fadeOut(400, addPostToStream(html)).remove(); $("#empty_message").fadeOut(400, addPostToStream(html)).hide();
} else { } else {
addPostToStream(html); addPostToStream(html);
} }