Files
iD/js/id/actions/delete_multiple.js
John Firebaugh c50c3121d8 Make Graph#entity strict
Use Graph#hasEntity for the previous behavior.
2013-04-24 09:27:37 -07:00

18 lines
473 B
JavaScript

iD.actions.DeleteMultiple = function(ids) {
return function(graph) {
var actions = {
way: iD.actions.DeleteWay,
node: iD.actions.DeleteNode,
relation: iD.actions.DeleteRelation
};
ids.forEach(function(id) {
if (graph.hasEntity(id)) { // It may have been deleted aready.
graph = actions[graph.entity(id).type](id)(graph);
}
});
return graph;
};
};