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;