summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-26 18:14:59 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-26 18:15:24 +0200
commitcad282b73f48b696e078c38abde3e3ec1bea691f (patch)
treeb4ebd464c9511cace7285512c557853d285d17cd /apps
parent1b2d09f9ca3e23abbb368f44b63df4133bbb4d6b (diff)
downloadnextcloud-server-cad282b73f48b696e078c38abde3e3ec1bea691f.tar.gz
nextcloud-server-cad282b73f48b696e078c38abde3e3ec1bea691f.zip
Added some error checking.
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/js/contacts.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 204fe18a52d..64b7af850ea 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -258,6 +258,9 @@ Contacts={
newid = id;
bookid = bookid?bookid:$('#contacts li[data-id="'+newid+'"]').data('bookid');
}
+ if(!bookid) {
+ bookid = $('#contacts h3').first().data('id');
+ }
var localLoadContact = function(newid, bookid) {
if($('.contacts li').length > 0) {
$('#contacts li[data-id="'+newid+'"]').addClass('active');
@@ -315,7 +318,6 @@ Contacts={
},
add:function(n, fn, aid, isnew){ // add a new contact
aid = aid?aid:$('#contacts h3.active').first().data('id');
- console.log('add() aid: ' + aid);
var localAddcontact = function(n, fn, aid, isnew) {
$.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid, isnew: isnew },
function(jsondata) {
@@ -1567,6 +1569,8 @@ Contacts={
scroll: true, scrollSensitivity: 100,
opacity: 0.7, helper: 'clone'
});
+ } else {
+ $('#contacts h3').first().addClass('active');
}
});
Contacts.UI.Card.update(id);