mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
d9900d8e4c
commit
716dc781e4
@ -380,11 +380,16 @@ RED.group = (function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var existingGroup;
|
||||||
|
|
||||||
// Second pass, ungroup any groups in the selection and add their contents
|
// Second pass, ungroup any groups in the selection and add their contents
|
||||||
// to the selection
|
// to the selection
|
||||||
for (var i=0; i<selection.nodes.length; i++) {
|
for (var i=0; i<selection.nodes.length; i++) {
|
||||||
n = selection.nodes[i];
|
n = selection.nodes[i];
|
||||||
if (n.type === "group") {
|
if (n.type === "group") {
|
||||||
|
if (!existingGroup) {
|
||||||
|
existingGroup = n;
|
||||||
|
}
|
||||||
ungroupHistoryEvent.groups.push(n);
|
ungroupHistoryEvent.groups.push(n);
|
||||||
nodes = nodes.concat(ungroup(n));
|
nodes = nodes.concat(ungroup(n));
|
||||||
} else {
|
} else {
|
||||||
@ -398,6 +403,10 @@ RED.group = (function() {
|
|||||||
// Finally, create the new group
|
// Finally, create the new group
|
||||||
var group = createGroup(nodes);
|
var group = createGroup(nodes);
|
||||||
if (group) {
|
if (group) {
|
||||||
|
if (existingGroup) {
|
||||||
|
group.style = existingGroup.style;
|
||||||
|
group.name = existingGroup.name;
|
||||||
|
}
|
||||||
RED.view.select({nodes:[group]})
|
RED.view.select({nodes:[group]})
|
||||||
}
|
}
|
||||||
historyEvent.events.push({
|
historyEvent.events.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user