mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Persistence] Remove persistence usage from TimelineSwimlaneDropHandler
This commit is contained in:
parent
bea9f22a0c
commit
f85ac79b4a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user