mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
25 lines
430 B
JavaScript
25 lines
430 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;
|
|
}
|