put ajax:success for publisher where it belongs

This commit is contained in:
danielvincent 2010-12-18 20:31:02 -08:00
parent d5916c9287
commit 01e557ba7a
2 changed files with 3 additions and 5 deletions

View file

@ -17,11 +17,6 @@
$("#publisher .options_and_submit").show(); $("#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){ $("#click_to_share").find("a").bind("click", function(evt){
$("#publisher").removeClass("closed"); $("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus(); $("#publisher").find("textarea").focus();

View file

@ -95,6 +95,9 @@ var Stream = {
$(".new_status_message").bind('ajax:success', function(data, json, xhr) { $(".new_status_message").bind('ajax:success', function(data, json, xhr) {
json = $.parseJSON(json); json = $.parseJSON(json);
WebSocketReceiver.addPostToStream(json['post_id'], json['html']); 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) { $(".new_status_message").bind('ajax:failure', function(data, html, xhr) {
alert('failed to post message!'); alert('failed to post message!');