From 049efae1a6f72c53d0b0b3ad6d3eb610920527a7 Mon Sep 17 00:00:00 2001 From: Dan Hansen Date: Mon, 22 Aug 2011 20:11:56 -0500 Subject: [PATCH] instantiate StreamElement widget after a post has been added to the stream by a user. time to clean publisher.js up. gross. --- public/javascripts/content-updater.js | 2 +- public/javascripts/publisher.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/javascripts/content-updater.js b/public/javascripts/content-updater.js index 306975035..a6d5721b0 100644 --- a/public/javascripts/content-updater.js +++ b/public/javascripts/content-updater.js @@ -42,7 +42,7 @@ var ContentUpdater = { $(html).appendTo(comments).fadeIn("fast"); Diaspora.page.timeAgo.updateTimeAgo(); - Diaspora.page.directionDetector.updateBinds(); + Diaspora.page.directionDetector.updateBinds() }, addLikesToPost: function(postGUID, html) { diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 8a3bbcf11..85f8387c9 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -381,13 +381,16 @@ var Publisher = { isPostVisible = true; }); - if(isPostVisible) + if(isPostVisible) { ContentUpdater.addPostToStream(json.html); - else + Diaspora.page.stream.addPost($("#" + json.post_id)); + } + else { Diaspora.widgets.flashMessages.render({ success: true, message: Diaspora.I18n.t('successfully_posted_message_to_an_aspects_that_is_not_visible') }); + } //collapse publisher Publisher.close();