summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-07-21 21:58:09 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-07-21 22:00:27 +0200
commiteb57544518cc0a12618fdb72b65b129c7d18c923 (patch)
treeebe760e66e4dfc22be20488ece129b9b825c5e5d
parent7d520bc7a9f395497c1793da3990a6f52a56086f (diff)
downloadnextcloud-server-eb57544518cc0a12618fdb72b65b129c7d18c923.tar.gz
nextcloud-server-eb57544518cc0a12618fdb72b65b129c7d18c923.zip
Added next/previous methods to contacts list.
-rw-r--r--apps/contacts/js/contacts.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index bf53753b14c..a0ad77d0749 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -1569,6 +1569,21 @@ Contacts={
}
return contact;
},
+ next:function(reverse) {
+ // TODO: Check if we're last-child/first-child and jump to next/prev address book.
+ var curlistitem = $('#contacts li[data-id="'+Contacts.UI.Card.id+'"]');
+ var newlistitem = reverse ? curlistitem.prev('li') : curlistitem.next('li');
+ if(newlistitem) {
+ curlistitem.removeClass('active');
+ Contacts.UI.Card.update({
+ cid:newlistitem.data('id'),
+ aid:newlistitem.data('bookid')
+ });
+ }
+ },
+ previous:function() {
+ this.next(true);
+ },
// Reload the contacts list.
update:function(params){
if(!params) { params = {}; }