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

Add method to show/hide shared addressbooks.

This commit is contained in:
Thomas Tanghus 2012-10-22 15:34:15 +02:00
parent 6badc525d9
commit 3bbf951fda

View File

@ -713,6 +713,23 @@ OC.Contacts = OC.Contacts || {};
}
}
/**
* Show/hide contacts belonging to shared addressbooks.
* @param boolean show. Whether to show or hide.
*/
ContactList.prototype.showSharedAddressbooks = function(show) {
console.log('ContactList.showSharedAddressbooks', show);
for(var contact in this.contacts) {
if(this.contacts[contact].access.owner !== OC.currentUser) {
if(show) {
this.contacts[contact].getListItemElement().show();
} else {
this.contacts[contact].getListItemElement().hide();
}
}
}
}
/**
* Show contacts in list
* @param Array contacts. A list of contact ids.