fadeOut on delete
This commit is contained in:
parent
bd31ff3ee3
commit
1212b34706
2 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue