fadeOut on delete

This commit is contained in:
zhitomirskiyi 2010-12-15 11:58:13 -08:00
parent bd31ff3ee3
commit 1212b34706
2 changed files with 7 additions and 2 deletions

View file

@ -65,11 +65,11 @@ class StatusMessagesController < ApplicationController
@status_message = current_user.my_posts.where(:_id => params[:id]).first
if @status_message
@status_message.destroy
render :nothing => true, :status => 200
else
Rails.logger.info "event=post_destroy status=failure user=#{current_user.diaspora_handle} reason='User does not own post'"
render :nothing => true, :status => 404
end
respond_with :location => root_url
end
def show

View file

@ -109,6 +109,11 @@ var Stream = {
$(".new_comment").live('ajax:failure', function(data, html, xhr) {
alert('failed to post message!');
});
$(".delete").live('ajax:success', function(data, html, xhr) {
$(this).parents(".message").fadeOut(150);
});
},
toggleComments: function(evt) {