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

Contacts: Effect for adding/removing to/from group.

This commit is contained in:
Thomas Tanghus 2012-11-23 01:12:53 +01:00
parent 46c6ccafcc
commit ddfe1b7994

View File

@ -288,7 +288,11 @@ GroupList.prototype.addTo = function(contactid, groupid, cb) {
if(jsondata.status === 'success') { if(jsondata.status === 'success') {
contacts = contacts.concat(ids).sort(); contacts = contacts.concat(ids).sort();
$groupelem.data('contacts', contacts); $groupelem.data('contacts', contacts);
$groupelem.find('.numcontacts').text(contacts.length); var $numelem = $groupelem.find('.numcontacts');
$numelem.text(contacts.length).switchClass('', 'active', 200);
setTimeout(function() {
$numelem.switchClass('active', '', 1000);
}, 2000);
if(typeof cb === 'function') { if(typeof cb === 'function') {
cb({status:'success', ids:ids}); cb({status:'success', ids:ids});
} else { } else {
@ -358,7 +362,11 @@ GroupList.prototype.removeFrom = function(contactid, groupid, cb) {
}); });
//console.log('contacts', contacts, contacts.indexOf(id), contacts.indexOf(String(id))); //console.log('contacts', contacts, contacts.indexOf(id), contacts.indexOf(String(id)));
$groupelem.data('contacts', contacts); $groupelem.data('contacts', contacts);
$groupelem.find('.numcontacts').text(contacts.length); var $numelem = $groupelem.find('.numcontacts');
$numelem.text(contacts.length).switchClass('', 'active', 200);
setTimeout(function() {
$numelem.switchClass('active', '', 1000);
}, 2000);
if(typeof cb === 'function') { if(typeof cb === 'function') {
cb({status:'success', ids:ids}); cb({status:'success', ids:ids});
} }