mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-02-07 01:54:16 +01:00
Added some error checking.
This commit is contained in:
parent
fb0d6cf7f7
commit
1d5c4c2529
@ -258,6 +258,9 @@ Contacts={
|
|||||||
newid = id;
|
newid = id;
|
||||||
bookid = bookid?bookid:$('#contacts li[data-id="'+newid+'"]').data('bookid');
|
bookid = bookid?bookid:$('#contacts li[data-id="'+newid+'"]').data('bookid');
|
||||||
}
|
}
|
||||||
|
if(!bookid) {
|
||||||
|
bookid = $('#contacts h3').first().data('id');
|
||||||
|
}
|
||||||
var localLoadContact = function(newid, bookid) {
|
var localLoadContact = function(newid, bookid) {
|
||||||
if($('.contacts li').length > 0) {
|
if($('.contacts li').length > 0) {
|
||||||
$('#contacts li[data-id="'+newid+'"]').addClass('active');
|
$('#contacts li[data-id="'+newid+'"]').addClass('active');
|
||||||
@ -315,7 +318,6 @@ Contacts={
|
|||||||
},
|
},
|
||||||
add:function(n, fn, aid, isnew){ // add a new contact
|
add:function(n, fn, aid, isnew){ // add a new contact
|
||||||
aid = aid?aid:$('#contacts h3.active').first().data('id');
|
aid = aid?aid:$('#contacts h3.active').first().data('id');
|
||||||
console.log('add() aid: ' + aid);
|
|
||||||
var localAddcontact = function(n, fn, aid, isnew) {
|
var localAddcontact = function(n, fn, aid, isnew) {
|
||||||
$.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid, isnew: isnew },
|
$.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid, isnew: isnew },
|
||||||
function(jsondata) {
|
function(jsondata) {
|
||||||
@ -1567,6 +1569,8 @@ Contacts={
|
|||||||
scroll: true, scrollSensitivity: 100,
|
scroll: true, scrollSensitivity: 100,
|
||||||
opacity: 0.7, helper: 'clone'
|
opacity: 0.7, helper: 'clone'
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
$('#contacts h3').first().addClass('active');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Contacts.UI.Card.update(id);
|
Contacts.UI.Card.update(id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user