[Persistence] Remove persistence usage from TimelineSwimlaneDropHandler

This commit is contained in:
Victor Woeltjen 2016-04-29 11:53:15 -07:00
parent bea9f22a0c
commit f85ac79b4a

View File

@ -31,16 +31,6 @@ define(
* @constructor
*/
function TimelineSwimlaneDropHandler(swimlane) {
// Utility function; like $q.when, but synchronous (to reduce
// performance impact when wrapping synchronous values)
function asPromise(value) {
return (value && value.then) ? value : {
then: function (callback) {
return asPromise(callback(value));
}
};
}
// Check if we are in edit mode
function inEditMode() {
return swimlane.domainObject.hasCapability("editor");
@ -76,16 +66,7 @@ define(
// Initiate mutation of a domain object
function doMutate(domainObject, mutator) {
return asPromise(
domainObject.useCapability("mutation", mutator)
).then(function () {
// Persist the results of mutation
var persistence = domainObject.getCapability("persistence");
if (persistence) {
// Persist the changes
persistence.persist();
}
});
return domainObject.useCapability("mutation", mutator);
}
// Check if this swimlane is in a state where a drop-after will