mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-29 11:24:11 +01:00
Contacts: Effect for adding/removing to/from group.
This commit is contained in:
parent
46c6ccafcc
commit
ddfe1b7994
12
js/app.js
12
js/app.js
@ -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});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user