empty message re-appears if all stream posts are deleted
This commit is contained in:
parent
8daf2d0fd5
commit
750b4b4388
3 changed files with 12 additions and 13 deletions
|
|
@ -12,10 +12,9 @@
|
|||
- for post in @posts
|
||||
= render type_partial(post), :post => post unless post.class == Album
|
||||
|
||||
- if @posts.size == 0
|
||||
#empty_message
|
||||
.null_arrow ⇧
|
||||
%h3 Nobody has said anything yet. Get the conversation started!
|
||||
#empty_message{:style => ("display:none" unless @posts.count == 0)}
|
||||
.null_arrow ⇧
|
||||
%h3 Nobody has said anything yet. Get the conversation started!
|
||||
|
||||
#pagination
|
||||
= will_paginate @posts
|
||||
|
|
|
|||
|
|
@ -12,10 +12,9 @@
|
|||
- for post in @posts
|
||||
= render type_partial(post), :post => post unless post.class == Album
|
||||
|
||||
- if @posts.size == 0
|
||||
#empty_message
|
||||
.null_arrow ⇧
|
||||
%h3 Nobody has said anything yet. Get the conversation started!
|
||||
#empty_message{:style => ("display:none" unless @posts.count == 0)}
|
||||
.null_arrow ⇧
|
||||
%h3 Nobody has said anything yet. Get the conversation started!
|
||||
|
||||
#pagination
|
||||
= will_paginate @posts
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue