1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-02-07 01:54:16 +01:00

Edit dialog remained if you deleted an address book while editing it. oc-1657

This commit is contained in:
Thomas Tanghus 2012-09-08 03:59:35 +02:00
parent c4c6323432
commit 0b42a3fb83

View File

@ -34,10 +34,13 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
if(check == false){ if(check == false){
return false; return false;
} else { } else {
var row = $('.addressbooks-settings tr[data-id="'+id+'"]');
OC.Contacts.loading(row.find('.name'));
$.post(OC.filePath('contacts', 'ajax', 'addressbook/delete.php'), { id: id}, function(jsondata) { $.post(OC.filePath('contacts', 'ajax', 'addressbook/delete.php'), { id: id}, function(jsondata) {
if (jsondata.status == 'success'){ if (jsondata.status == 'success'){
$('#contacts h3[data-id="'+id+'"],#contacts ul[data-id="'+id+'"]').remove(); $('#contacts h3[data-id="'+id+'"],#contacts ul[data-id="'+id+'"]').remove();
$('.addressbooks-settings tr[data-id="'+id+'"]').remove() row.remove()
OC.Contacts.Settings.Addressbook.showActions(['new',]);
OC.Contacts.Contacts.update(); OC.Contacts.Contacts.update();
} else { } else {
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error')); OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));