mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-16 02:32:53 +00:00
22 lines
458 B
JavaScript
22 lines
458 B
JavaScript
iD.actions.CopyEntity = function(id, fromGraph, deep) {
|
|
var newEntities = [];
|
|
|
|
var action = function(graph) {
|
|
var entity = fromGraph.entity(id);
|
|
|
|
newEntities = entity.copy(deep, fromGraph);
|
|
|
|
for (var i = 0; i < newEntities.length; i++) {
|
|
graph = graph.replace(newEntities[i]);
|
|
}
|
|
|
|
return graph;
|
|
};
|
|
|
|
action.newEntities = function() {
|
|
return newEntities;
|
|
};
|
|
|
|
return action;
|
|
};
|