move ui feedback into success callback
This commit is contained in:
parent
5ff05139a3
commit
b2ff1878e3
1 changed files with 10 additions and 6 deletions
|
|
@ -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;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue