Fix dragging an email in compose from one field and dropping it into the same field, removes the item

This commit is contained in:
Hadi Nategh 2016-06-15 13:43:28 +02:00
parent f69c198183
commit 695a72e3e8

View File

@ -4588,7 +4588,7 @@ app.classes.mail = AppJS.extend(
if (!jQuery.isEmptyObject(fromWidget) if (!jQuery.isEmptyObject(fromWidget)
&& !(ui.draggable.attr('class').search('mailCompose_copyEmail') > -1)) && !(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 //Not successful remove, returns the item to its origin
jQuery(ui.draggable).draggable('option','revert',true); jQuery(ui.draggable).draggable('option','revert',true);
@ -4609,8 +4609,6 @@ app.classes.mail = AppJS.extend(
delete dragItems.splice(i,1); delete dragItems.splice(i,1);
} }
}); });
//Destroy draggables after dropping, we need to enable them again
dragItems.draggable('destroy');
} }
} }
}); });