From 01e557ba7a628c7a495edebe6183b714c258096c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Dec 2010 20:31:02 -0800 Subject: [PATCH] put ajax:success for publisher where it belongs --- app/views/shared/_publisher.haml | 5 ----- public/javascripts/stream.js | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) 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!');