summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-08-02 18:50:20 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-08-02 18:50:20 +0200
commita484ee817cb1ee1daad9341d90d9b36fc0ada7d5 (patch)
tree29d1ea58b057f8bbfbe7e6ac97f0d1b241d88689 /apps
parenta1239a37aa51b5a31474a23dcf00a7532fcc4ea4 (diff)
downloadnextcloud-server-a484ee817cb1ee1daad9341d90d9b36fc0ada7d5.tar.gz
nextcloud-server-a484ee817cb1ee1daad9341d90d9b36fc0ada7d5.zip
If first addressbook was empty it was seen as if there where no contacts at all.
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/js/contacts.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 01301e0d533..a708352cba0 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -316,8 +316,11 @@ OC.Contacts={
console.log('Card, cid: ' + params.cid + ' aid: ' + params.aid);
var newid, bookid, firstitem;
if(!parseInt(params.cid) && !parseInt(params.aid)) {
- firstitem = $('#contacts ul').first().find('li:first-child');
+ firstitem = $('#contacts ul').find('li:first-child');
if(firstitem.length > 0) {
+ if(firstitem.length > 1) {
+ firstitem = firstitem.first();
+ }
newid = parseInt(firstitem.data('id'));
bookid = parseInt(firstitem.data('bookid'));
}