mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
25 lines
425 B
JavaScript
25 lines
425 B
JavaScript
export function actionCopyEntities(ids, fromGraph) {
|
|
var copies = {};
|
|
|
|
|
|
var action = function(graph) {
|
|
ids.forEach(function(id) {
|
|
fromGraph.entity(id).copy(fromGraph, copies);
|
|
});
|
|
|
|
for (var id in copies) {
|
|
graph = graph.replace(copies[id]);
|
|
}
|
|
|
|
return graph;
|
|
};
|
|
|
|
|
|
action.copies = function() {
|
|
return copies;
|
|
};
|
|
|
|
|
|
return action;
|
|
}
|