[New Edit Mode] #636 Removed edit concerns from DropGesture

This commit is contained in:
Henry
2016-05-13 13:45:14 -07:00
parent a11dba88b2
commit 54a0de4a08
4 changed files with 24 additions and 22 deletions

View File

@ -54,9 +54,6 @@ define(
// ...and broadcast the event. This allows specific
// views to have post-drop behavior which depends on
// drop position.
// Also broadcast the editableDomainObject to
// avoid race condition against non-editable
// version in EditRepresenter
scope.$broadcast(
GestureConstants.MCT_DROP_EVENT,
id,
@ -93,21 +90,13 @@ define(
function drop(e) {
var event = (e || {}).originalEvent || e,
id = event.dataTransfer.getData(GestureConstants.MCT_DRAG_TYPE),
domainObjectType = domainObject.getModel().type;
id = event.dataTransfer.getData(GestureConstants.MCT_DRAG_TYPE);
// Handle the drop; add the dropped identifier to the
// destination domain object's composition, and persist
// the change.
if (id) {
e.preventDefault();
//Use scope.apply, drop event is outside digest cycle
scope.$apply(function () {
if (domainObjectType !== 'folder') {
domainObject.getCapability('action').perform('edit');
}
});
$q.when(action && action.perform()).then(function () {
broadcastDrop(id, event);
});