diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 6389475c9..9ce6b2130 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -17,11 +17,6 @@ $("#publisher .options_and_submit").show(); }); - $("#publisher form").live("ajax:success", function(){ - $("#publisher").addClass("closed"); - $("#photodropzone").find('li').remove(); - }); - $("#click_to_share").find("a").bind("click", function(evt){ $("#publisher").removeClass("closed"); $("#publisher").find("textarea").focus(); diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index d0840b9e6..b52fbbbfc 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -95,6 +95,9 @@ var Stream = { $(".new_status_message").bind('ajax:success', function(data, json, xhr) { json = $.parseJSON(json); WebSocketReceiver.addPostToStream(json['post_id'], json['html']); + //collapse publisher + $("#publisher").addClass("closed"); + $("#photodropzone").find('li').remove(); }); $(".new_status_message").bind('ajax:failure', function(data, html, xhr) { alert('failed to post message!');