mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Persistence] Remove persistence usage from TimelineDragHandler
This commit is contained in:
parent
f7f934f0e8
commit
3f330dccf1
@ -37,7 +37,6 @@ define(
|
||||
*/
|
||||
function TimelineDragHandler(domainObject, objectLoader) {
|
||||
var timespans = {},
|
||||
persists = {},
|
||||
mutations = {},
|
||||
compositions = {},
|
||||
dirty = {};
|
||||
@ -73,19 +72,14 @@ define(
|
||||
}
|
||||
|
||||
// Persist changes for objects by id (when dragging ends)
|
||||
function doPersist(id) {
|
||||
var persistence = persists[id],
|
||||
mutation = mutations[id];
|
||||
function finalMutate(id) {
|
||||
var mutation = mutations[id];
|
||||
if (mutation) {
|
||||
// Mutate just to update the timestamp (since we
|
||||
// explicitly don't do this during the drag to
|
||||
// avoid firing a ton of refreshes.)
|
||||
mutation.mutate(function () {});
|
||||
}
|
||||
if (persistence) {
|
||||
// Persist the changes
|
||||
persistence.persist();
|
||||
}
|
||||
}
|
||||
|
||||
// Use the object loader to get objects which have timespans
|
||||
@ -107,7 +101,7 @@ define(
|
||||
*/
|
||||
persist: function () {
|
||||
// Persist every dirty object...
|
||||
Object.keys(dirty).forEach(doPersist);
|
||||
Object.keys(dirty).forEach(finalMutate);
|
||||
// Clear out the dirty list
|
||||
dirty = {};
|
||||
},
|
||||
@ -255,4 +249,4 @@ define(
|
||||
|
||||
return TimelineDragHandler;
|
||||
}
|
||||
);
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user