1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Contacts: Remove group from internal list on deletion.

This commit is contained in:
Thomas Tanghus 2013-03-29 17:32:06 +01:00
parent 00f04fea49
commit 7a16b4f870

View File

@ -387,10 +387,16 @@ OC.Contacts = OC.Contacts || {};
console.log('delete group', groupid, contacts);
$.when(this.storage.deleteGroup(name)).then(function(response) {
if (!response.error) {
$.each(self.categories, function(idx, category) {
if(category.id === groupid) {
self.categories.splice(self.categories.indexOf(category), 1);
return false; // Break loop
}
});
$(document).trigger('status.group.groupremoved', {
groupid: groupid,
newgroupid: parseInt($newelem.data('id')),
groupname: self.nameById(groupid),
groupname: name,
contacts: contacts
});
$elem.remove();