From ca38da7cbdb44b4ee0f368ab8e5b201ca569146d Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sun, 25 Nov 2012 12:12:16 -0400 Subject: [PATCH] Extract Graph#modifications --- js/iD/graph/Graph.js | 6 ++++++ js/iD/renderer/Map.js | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/iD/graph/Graph.js b/js/iD/graph/Graph.js index daaf1b5f0..c2e44f259 100644 --- a/js/iD/graph/Graph.js +++ b/js/iD/graph/Graph.js @@ -84,5 +84,11 @@ iD.Graph.prototype = { } entity.nodes = nodes; return entity; + }, + + modifications: function() { + _.filter(this.entities, function(entity) { + return entity.modified; + }); } }; diff --git a/js/iD/renderer/Map.js b/js/iD/renderer/Map.js index c6cf90b2b..269dc1d19 100644 --- a/js/iD/renderer/Map.js +++ b/js/iD/renderer/Map.js @@ -535,9 +535,7 @@ iD.Map = function(elem, connection) { } function commit() { - connection.createChangeset(_.filter(history.graph().entities, function(e) { - return e.modified; - })); + connection.createChangeset(history.graph().modifications()); } map.handleDrag = handleDrag;