From c981fe5d80c379e6de6f05faa5659c615e82d80d Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 25 Jan 2013 16:16:49 -0500 Subject: [PATCH] Revert "Wrap all actions in Graph#update" This reverts commit 310592337136502981ef0e1025a5dfcdd6f273e7. See #508. --- js/id/actions/move_way.js | 16 ++++++++-------- js/id/graph/history.js | 9 ++++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/js/id/actions/move_way.js b/js/id/actions/move_way.js index 09ab8fd50..8301539c4 100644 --- a/js/id/actions/move_way.js +++ b/js/id/actions/move_way.js @@ -1,14 +1,14 @@ iD.actions.MoveWay = function(wayId, delta, projection) { return function(graph) { - var way = graph.entity(wayId); + return graph.update(function (graph) { + var way = graph.entity(wayId); - _.uniq(way.nodes).forEach(function(id) { - var node = graph.entity(id), - start = projection(node.loc), - end = projection.invert([start[0] + delta[0], start[1] + delta[1]]); - graph = graph.replace(node.move(end)); + _.uniq(way.nodes).forEach(function (id) { + var node = graph.entity(id), + start = projection(node.loc), + end = projection.invert([start[0] + delta[0], start[1] + delta[1]]); + graph = graph.replace(node.move(end)); + }); }); - - return graph; }; }; diff --git a/js/id/graph/history.js b/js/id/graph/history.js index 31f32618a..5fcb41825 100644 --- a/js/id/graph/history.js +++ b/js/id/graph/history.js @@ -12,11 +12,10 @@ iD.History = function() { annotation = actions.pop(); } - var graph = stack[index].graph.update(function (graph) { - for (var i = 0; i < actions.length; i++) { - graph = actions[i](graph); - } - }); + var graph = stack[index].graph; + for (var i = 0; i < actions.length; i++) { + graph = actions[i](graph); + } return {graph: graph, annotation: annotation, imagery_used: imagery_used}; }