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

Don't try to select a group that doesn't exist.

This commit is contained in:
Thomas Tanghus 2013-09-03 19:23:43 +02:00
parent e76606b419
commit 31c19e9b57

View File

@ -98,7 +98,7 @@ OC.Contacts = OC.Contacts || {};
id = params.element.data('id');
$elem = params.element;
}
if(!$elem) {
if(!$elem.length) {
self.selectGroup({id:'all'});
return;
}
@ -368,17 +368,13 @@ OC.Contacts = OC.Contacts || {};
$.each(ids, function(idx, id) {
contacts.splice(contacts.indexOf(id), 1);
});
$groupelem.find('.numcontacts').text(contacts.length);
//console.log('contacts', contacts, contacts.indexOf(id), contacts.indexOf(String(id)));
$groupelem.data('contacts', contacts);
if(doPost && !onlyInternal) {
var groupname = this.nameById(groupid);
$.when(this.storage.removeFromGroup(ids, groupid, groupname)).then(function(response) {
if(!response.error) {
var $numelem = $groupelem.find('.numcontacts');
$numelem.text(contacts.length).switchClass('', 'active', 200);
setTimeout(function() {
$numelem.switchClass('active', '', 1000);
}, 2000);
if(typeof cb === 'function') {
cb({ids:ids});
}