From 4251a3a093b807452ec5402c0f1535751112039e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 4 Dec 2010 17:02:29 -0800 Subject: [PATCH] prompt to 'get the conversation started' on new aspect page fades out when first message in aspect is posted --- public/javascripts/web-socket-receiver.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/public/javascripts/web-socket-receiver.js b/public/javascripts/web-socket-receiver.js index 7df3d3bc5..9739c9160 100644 --- a/public/javascripts/web-socket-receiver.js +++ b/public/javascripts/web-socket-receiver.js @@ -91,21 +91,24 @@ processPerson: function(response){ processPost: function(className, postId, html, aspectIds){ if(WebSocketReceiver.onPageForAspects(aspectIds)){ - if( $("#no_posts").is(":visible") ){ - $("#no_posts").fadeOut(400, WebSocketReceiver.addPostToStream(postId, html)).hide(); - } else { - WebSocketReceiver.addPostToStream(postId, html); - } + WebSocketReceiver.addPostToStream(postId, html); } }, addPostToStream: function(postId, html){ if( $(".message[data-guid='"+postId+"']").length == 0 ){ - $("#main_stream:not('.show')").prepend( - $(html).fadeIn("fast", function(){ - $("#main_stream").find("label").first().inFieldLabels(); - }) - ); + var showMessage = function(){ $("#main_stream:not('.show')").prepend( + $(html).fadeIn("fast", function(){ + $("#main_stream").find("label").first().inFieldLabels(); + }) + ); + }; + + if( $("#no_posts").is(":visible") ){ + $("#no_posts").fadeOut(400, showMessage()).hide(); + } else { + showMessage(); + } } },