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

Added method to test if a contact is in a group.

This commit is contained in:
Thomas Tanghus 2012-10-23 06:24:22 +02:00
parent e5c6665a05
commit 3600c6c74a

View File

@ -111,7 +111,11 @@ GroupList.prototype.findById = function(id) {
}
GroupList.prototype.isFavorite = function(contactid) {
var $groupelem = this.findById('fav');
return this.inGroup(contactid, 'fav');
}
GroupList.prototype.inGroup = function(contactid, groupid) {
var $groupelem = this.findById(groupid);
var contacts = $groupelem.data('contacts');
return (contacts.indexOf(contactid) !== -1);
}