1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Contacts: Decrement 'All' group on contact deletion.

This commit is contained in:
Thomas Tanghus 2012-12-10 05:51:35 +01:00
parent 6dd8869ed3
commit c0e9e80dce

View File

@ -332,6 +332,18 @@ GroupList.prototype.removeFrom = function(contactid, groupid, cb) {
var $groupelem = this.findById(groupid);
var contacts = $groupelem.data('contacts');
var ids = [];
// If it's the 'all' group simply decrement the number
if(groupid === 'all') {
var $numelem = $groupelem.find('.numcontacts');
$numelem.text(parseInt($numelem.text()-1)).switchClass('', 'active', 200);
setTimeout(function() {
$numelem.switchClass('active', '', 1000);
}, 2000);
if(typeof cb === 'function') {
cb({status:'success', ids:[id]});
}
}
// If the contact is in the category remove it from internal list.
if(!contacts) {
if(typeof cb === 'function') {