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

View file

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

View file

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