From 695a72e3e816cada760d81869ba7458354d10018 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 15 Jun 2016 13:43:28 +0200 Subject: [PATCH] Fix dragging an email in compose from one field and dropping it into the same field, removes the item --- mail/js/app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index 54fdf4060b..5308332d0a 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -4548,7 +4548,7 @@ app.classes.mail = AppJS.extend( } var draggedValue = ui.draggable.text(); - + // index of draggable item in selection list var dValueKey = draggedValue; @@ -4588,7 +4588,7 @@ app.classes.mail = AppJS.extend( if (!jQuery.isEmptyObject(fromWidget) && !(ui.draggable.attr('class').search('mailCompose_copyEmail') > -1)) { - if (!_removeDragged(fromWidget, dValueKey)) + if (widget.node != fromWidget.node && !_removeDragged(fromWidget, dValueKey)) { //Not successful remove, returns the item to its origin jQuery(ui.draggable).draggable('option','revert',true); @@ -4609,8 +4609,6 @@ app.classes.mail = AppJS.extend( delete dragItems.splice(i,1); } }); - //Destroy draggables after dropping, we need to enable them again - dragItems.draggable('destroy'); } } });