mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix copy/paste of nested groups
This commit is contained in:
parent
80d65b5acb
commit
d590bbdd2c
@ -998,6 +998,7 @@ RED.nodes = (function() {
|
||||
var new_nodes = [];
|
||||
var new_links = [];
|
||||
var new_groups = [];
|
||||
var new_group_set = new Set();
|
||||
var nid;
|
||||
var def;
|
||||
var configNode;
|
||||
@ -1326,6 +1327,7 @@ RED.nodes = (function() {
|
||||
new_nodes.push(node);
|
||||
} else if (node.type === "group") {
|
||||
new_groups.push(node);
|
||||
new_group_set.add(node.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1433,9 +1435,8 @@ RED.nodes = (function() {
|
||||
var groupDepthMap = {};
|
||||
for (i=0;i<new_groups.length;i++) {
|
||||
n = new_groups[i];
|
||||
if (n.g && node_map[n.g]) {
|
||||
n.g = node_map[n.g].id;
|
||||
} else {
|
||||
|
||||
if (n.g && !new_group_set.has(n.g)) {
|
||||
delete n.g;
|
||||
}
|
||||
n.nodes = n.nodes.map(function(id) {
|
||||
|
Loading…
Reference in New Issue
Block a user