summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-07-22 01:34:05 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-07-23 01:17:38 +0200
commit294e65fa38b3ba5575285c65f11eeb80000ffbe2 (patch)
tree401412e16e7b6e99accec43ee345d5386d8dea38 /apps
parent641bd7a456dc811c7b6c8f721f1c20028d8bc53e (diff)
downloadnextcloud-server-294e65fa38b3ba5575285c65f11eeb80000ffbe2.tar.gz
nextcloud-server-294e65fa38b3ba5575285c65f11eeb80000ffbe2.zip
Use insertContact
Diffstat (limited to 'apps')
-rw-r--r--apps/contacts/js/contacts.js17
1 files changed, 4 insertions, 13 deletions
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index dcfd8e71d96..7c1304c559a 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -1510,21 +1510,12 @@ Contacts={
$.post(OC.filePath('contacts', 'ajax', 'movetoaddressbook.php'), { ids: dragitem.data('id'), aid: droptarget.data('id') },
function(jsondata){
if(jsondata.status == 'success'){
- // Do some inserting/removing/sorting magic
- var name = $(dragitem).find('a').html();
- var added = false;
- $(droplist).children().each(function(){
- if ($(this).text().toLowerCase() > name.toLowerCase()) {
- $(this).before(dragitem.detach()); //.fadeIn('slow');
- added = true;
- return false;
- }
- });
- if(!added) {
- $(droplist).append(dragitem.detach());
- }
dragitem.attr('data-bookid', droptarget.data('id'))
dragitem.data('bookid', droptarget.data('id'));
+ Contacts.UI.Contacts.insertContact({
+ contactlist:droplist,
+ contact:dragitem.detach()
+ });
Contacts.UI.Contacts.scrollTo(dragitem.data('id'));
} else {
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));