[Persistence] Remove persistence usage from TimelineDragHandler

This commit is contained in:
Victor Woeltjen 2016-04-29 11:50:02 -07:00
parent f7f934f0e8
commit 3f330dccf1

View File

@ -37,7 +37,6 @@ define(
*/ */
function TimelineDragHandler(domainObject, objectLoader) { function TimelineDragHandler(domainObject, objectLoader) {
var timespans = {}, var timespans = {},
persists = {},
mutations = {}, mutations = {},
compositions = {}, compositions = {},
dirty = {}; dirty = {};
@ -73,19 +72,14 @@ define(
} }
// Persist changes for objects by id (when dragging ends) // Persist changes for objects by id (when dragging ends)
function doPersist(id) { function finalMutate(id) {
var persistence = persists[id], var mutation = mutations[id];
mutation = mutations[id];
if (mutation) { if (mutation) {
// Mutate just to update the timestamp (since we // Mutate just to update the timestamp (since we
// explicitly don't do this during the drag to // explicitly don't do this during the drag to
// avoid firing a ton of refreshes.) // avoid firing a ton of refreshes.)
mutation.mutate(function () {}); mutation.mutate(function () {});
} }
if (persistence) {
// Persist the changes
persistence.persist();
}
} }
// Use the object loader to get objects which have timespans // Use the object loader to get objects which have timespans
@ -107,7 +101,7 @@ define(
*/ */
persist: function () { persist: function () {
// Persist every dirty object... // Persist every dirty object...
Object.keys(dirty).forEach(doPersist); Object.keys(dirty).forEach(finalMutate);
// Clear out the dirty list // Clear out the dirty list
dirty = {}; dirty = {};
}, },
@ -255,4 +249,4 @@ define(
return TimelineDragHandler; return TimelineDragHandler;
} }
); );