[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) {
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 = {};
},