mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
Add meta group "Ungrouped". Refs #28
This commit is contained in:
parent
5940855319
commit
3f3d701322
@ -619,6 +619,8 @@ OC.Contacts = OC.Contacts || {
|
||||
self.contacts.showContacts(result.contacts);
|
||||
} else if(result.type === 'shared') {
|
||||
self.contacts.showFromAddressbook(self.currentgroup, true, true);
|
||||
} else if(result.type === 'uncategorized') {
|
||||
self.contacts.showUncategorized();
|
||||
} else {
|
||||
self.contacts.showContacts(self.currentgroup);
|
||||
}
|
||||
|
@ -1786,6 +1786,23 @@ OC.Contacts = OC.Contacts || {};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Show only uncategorized contacts.
|
||||
* @param int aid. Addressbook id.
|
||||
* @param boolean show. Whether to show or hide.
|
||||
* @param boolean hideothers. Used when showing shared addressbook as a group.
|
||||
*/
|
||||
ContactList.prototype.showUncategorized = function() {
|
||||
console.log('ContactList.showUncategorized');
|
||||
for(var contact in this.contacts) {
|
||||
if(this.contacts[contact].getPreferredValue('CATEGORIES', []).length > 0) {
|
||||
this.contacts[contact].getListItemElement().show();
|
||||
} else {
|
||||
this.contacts[contact].getListItemElement().hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Show/hide contacts belonging to shared addressbooks.
|
||||
* @param boolean show. Whether to show or hide.
|
||||
|
@ -734,6 +734,9 @@ OC.Contacts = OC.Contacts || {};
|
||||
$elem.data('id', shared.id);
|
||||
$elem.appendTo($groupList);
|
||||
});
|
||||
if(!self.findById('uncategorized').length) {
|
||||
tmpl.octemplate({id: 'uncategorized', type: 'uncategorized', num: '', name: t('contacts', 'Not grouped')}).appendTo($groupList);
|
||||
}
|
||||
$groupList.sortable({
|
||||
items: 'li[data-type="category"]',
|
||||
stop: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user