mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-29 11:24:11 +01:00
Improve prev/next selection on delete.
This commit is contained in:
parent
1e88cfd2b9
commit
c973c35150
@ -380,12 +380,12 @@ Contacts={
|
||||
if(jsondata.status == 'success'){
|
||||
var newid = '', bookid;
|
||||
var curlistitem = $('#contacts li[data-id="'+jsondata.data.id+'"]');
|
||||
var newlistitem = curlistitem.prev();
|
||||
var newlistitem = curlistitem.prev('li');
|
||||
if(newlistitem == undefined) {
|
||||
newlistitem = curlistitem.next();
|
||||
newlistitem = curlistitem.next('li');
|
||||
}
|
||||
curlistitem.remove();
|
||||
if(newlistitem != undefined) {
|
||||
if(!$(newlistitem).is('li')) {
|
||||
newid = newlistitem.data('id');
|
||||
bookid = newlistitem.data('id');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user