diff --git a/platform/commonUI/edit/bundle.js b/platform/commonUI/edit/bundle.js index e766d96e56..ae0b2c6ba2 100644 --- a/platform/commonUI/edit/bundle.js +++ b/platform/commonUI/edit/bundle.js @@ -159,7 +159,6 @@ define([ "name": "Remove", "description": "Remove this object from its containing object.", "depends": [ - "$q", "navigationService" ] }, diff --git a/platform/commonUI/edit/src/actions/RemoveAction.js b/platform/commonUI/edit/src/actions/RemoveAction.js index dd95616289..b2a8fd5128 100644 --- a/platform/commonUI/edit/src/actions/RemoveAction.js +++ b/platform/commonUI/edit/src/actions/RemoveAction.js @@ -41,9 +41,8 @@ define( * @constructor * @implements {Action} */ - function RemoveAction($q, navigationService, context) { + function RemoveAction(navigationService, context) { this.domainObject = (context || {}).domainObject; - this.$q = $q; this.navigationService = navigationService; } @@ -53,8 +52,7 @@ define( * fulfilled when the action has completed. */ RemoveAction.prototype.perform = function () { - var $q = this.$q, - navigationService = this.navigationService, + var navigationService = this.navigationService, domainObject = this.domainObject; /* * Check whether an object ID matches the ID of the object being @@ -73,15 +71,6 @@ define( model.composition = model.composition.filter(isNotObject); } - /* - * Invoke persistence on a domain object. This will be called upon - * the removed object's parent (as its composition will have changed.) - */ - function doPersist(domainObject) { - var persistence = domainObject.getCapability('persistence'); - return persistence && persistence.persist(); - } - /* * Checks current object and ascendants of current * object with object being removed, if the current @@ -121,15 +110,10 @@ define( // navigates to existing object up tree checkObjectNavigation(object, parent); - return $q.when( - parent.useCapability('mutation', doMutate) - ).then(function () { - return doPersist(parent); - }); + return parent.useCapability('mutation', doMutate); } - return $q.when(domainObject) - .then(removeFromContext); + return removeFromContext(domainObject); }; // Object needs to have a parent for Remove to be applicable