summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-24 01:48:37 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-24 15:07:44 +0200
commit9e6d2f2f82322f499722c7db8b8df5d9469ea1e5 (patch)
treeccbd38a016e57d40492195457426c17a4e27aab4 /apps
parent0ab6e2ee3d88c9e2e3ada339ccd9b9f921d70598 (diff)
downloadnextcloud-server-9e6d2f2f82322f499722c7db8b8df5d9469ea1e5.tar.gz
nextcloud-server-9e6d2f2f82322f499722c7db8b8df5d9469ea1e5.zip
Improve prev/next selection on delete.
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/js/contacts.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index 6f5602c2112..0654976a6dd 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -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');
}