From b2ff1878e31e0a9ee9326cd37793cb930e66e98f Mon Sep 17 00:00:00 2001 From: Florian Staudacher Date: Sat, 31 Aug 2013 00:02:42 +0200 Subject: [PATCH] move ui feedback into success callback --- app/assets/javascripts/people.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/people.js b/app/assets/javascripts/people.js index 57ae2a3bf..d9f9eeb2b 100644 --- a/app/assets/javascripts/people.js +++ b/app/assets/javascripts/people.js @@ -10,13 +10,17 @@ $(document).ready(function() { $('#profile_buttons .profile_button div').tooltip({placement: 'bottom'}); $('#profile_buttons .sharing_message_container').tooltip({placement: 'bottom'}); $("#block_user_button").click(function(evt) { - if(!confirm(Diaspora.I18n.t('ignore_user'))) { return } + if(!confirm(Diaspora.I18n.t('ignore_user'))) { return; } var personId = $(this).data('person-id'); var block = new app.models.Block(); - block.save({block : {person_id : personId}}); - $('#profile_buttons').attr('class', 'blocked'); - $('#sharing_message').attr('class', 'icons-circle'); - $('.profile_button, .white_bar').remove(); + block.save({block : {person_id : personId}}, { + success: function() { + $('#profile_buttons').attr('class', 'blocked'); + $('#sharing_message').attr('class', 'icons-circle'); + $('.profile_button, .white_bar').remove(); + } + }); + return false; - }); + }); });