If first addressbook was empty it was seen as if there where no contacts at all.

This commit is contained in:
Thomas Tanghus 2012-08-02 18:50:20 +02:00
parent a1239a37aa
commit a484ee817c
1 changed files with 4 additions and 1 deletions

View File

@ -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'));
}