1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix up subflow port wiring

This commit is contained in:
Nick O'Leary 2020-07-06 18:11:47 +01:00
parent 6c04402a98
commit 0243a902b2
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -2414,11 +2414,16 @@ RED.view = (function() {
// This is not a virtualLink - which means it started // This is not a virtualLink - which means it started
// on a regular node port. Need to ensure the this isn't // on a regular node port. Need to ensure the this isn't
// connecting to a link node virual port. // connecting to a link node virual port.
//
// PORT_TYPE_OUTPUT=0
// PORT_TYPE_INPUT=1
if (!( if (!(
(d.type === "link out" && portType === PORT_TYPE_OUTPUT) || (d.type === "link out" && portType === PORT_TYPE_OUTPUT) ||
(d.type === "link in" && portType === PORT_TYPE_INPUT) || (d.type === "link in" && portType === PORT_TYPE_INPUT) ||
(portType === PORT_TYPE_OUTPUT && mouseup_node.outputs === 0) || (portType === PORT_TYPE_OUTPUT && mouseup_node.type !== "subflow" && mouseup_node.outputs === 0) ||
(portType === PORT_TYPE_INPUT && mouseup_node.inputs === 0) (portType === PORT_TYPE_INPUT && mouseup_node.type !== "subflow" && mouseup_node.inputs === 0) ||
(drag_line.portType === PORT_TYPE_INPUT && mouseup_node.type === "subflow" && (mouseup_node.direction === "status" || mouseup_node.direction === "out")) ||
(drag_line.portType === PORT_TYPE_OUTPUT && mouseup_node.type === "subflow" && mouseup_node.direction === "in")
)) { )) {
var existingLink = RED.nodes.filterLinks({source:src,target:dst,sourcePort: src_port}).length !== 0; var existingLink = RED.nodes.filterLinks({source:src,target:dst,sourcePort: src_port}).length !== 0;
if (!existingLink) { if (!existingLink) {