mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
[groups] Prevent subflow port nodes being added group
This commit is contained in:
parent
7bc3b662e4
commit
7c91c4ae5a
@ -345,6 +345,10 @@ RED.group = (function() {
|
||||
if (nodes.length === 0) {
|
||||
return;
|
||||
}
|
||||
if (nodes.filter(function(n) { return n.type === "subflow" }).length > 0) {
|
||||
RED.notify("Cannot add subflow ports to a group","error");
|
||||
return;
|
||||
}
|
||||
// nodes is an array
|
||||
// each node must be on the same tab (z)
|
||||
var group = {
|
||||
@ -416,6 +420,7 @@ RED.group = (function() {
|
||||
// Second pass - add them to the group
|
||||
for (i=0;i<nodes.length;i++) {
|
||||
n = nodes[i];
|
||||
if (n.type !== "subflow") {
|
||||
if (g && n.g === g.id) {
|
||||
var ni = g.nodes.indexOf(n);
|
||||
if (ni > -1) {
|
||||
@ -431,7 +436,11 @@ RED.group = (function() {
|
||||
group.h = Math.max(group.h,n.y+n.h/2+25-group.y);
|
||||
}
|
||||
}
|
||||
|
||||
markDirty(group);
|
||||
}
|
||||
function removeFromGroup(group, nodes, reparent) {
|
||||
console.log('rfg',group,nodes);
|
||||
if (!Array.isArray(nodes)) {
|
||||
nodes = [nodes];
|
||||
}
|
||||
|
@ -1382,7 +1382,7 @@ if (DEBUG_EVENTS) { console.warn("canvasMouseDown", mouse_mode); }
|
||||
},100);
|
||||
}
|
||||
}
|
||||
if (!node.n.g && activeGroups) {
|
||||
if (node.n.type !== 'subflow' && !node.n.g && activeGroups) {
|
||||
if (!groupHoverTimer) {
|
||||
groupHoverTimer = setTimeout(function() {
|
||||
activeHoverGroup = getGroupAt(node.n.x,node.n.y);
|
||||
|
Loading…
Reference in New Issue
Block a user