Files
iD/modules/actions/delete_multiple.js
Bryan Housel 37534aed0e More cleanup of operations and post-paste behavior
* Support move, rotate, reflect, delete post paste on multiselection
* Improve text and error msgs for singular vs multi selections
* Move `disabled` checks from actions to operations
* Reproject center of rotation (closes #3667)
* Cleanup tests
2016-12-21 23:58:13 -05:00

27 lines
623 B
JavaScript

import { actionDeleteNode } from './delete_node';
import { actionDeleteRelation } from './delete_relation';
import { actionDeleteWay } from './delete_way';
export function actionDeleteMultiple(ids) {
var actions = {
way: actionDeleteWay,
node: actionDeleteNode,
relation: actionDeleteRelation
};
var action = function(graph) {
ids.forEach(function(id) {
if (graph.hasEntity(id)) { // It may have been deleted aready.
graph = actions[graph.entity(id).type](id)(graph);
}
});
return graph;
};
return action;
}