Extract Graph#modifications

This commit is contained in:
John Firebaugh
2012-11-25 12:12:16 -04:00
parent efb521aeb5
commit ca38da7cbd
2 changed files with 7 additions and 3 deletions

View File

@@ -84,5 +84,11 @@ iD.Graph.prototype = {
}
entity.nodes = nodes;
return entity;
},
modifications: function() {
_.filter(this.entities, function(entity) {
return entity.modified;
});
}
};

View File

@@ -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;