mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-30 19:52:17 +01:00
Added some error checking.
This commit is contained in:
parent
fb0d6cf7f7
commit
1d5c4c2529
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user