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

Merge pull request #3370 from node-red/fix-vertical-align-subflow-port

Fix vertical align subflow port
This commit is contained in:
Nick O'Leary 2022-01-25 17:09:05 +00:00 committed by GitHub
commit c136d22382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View File

@ -503,7 +503,7 @@
hasNonBlankLabel = hasNonBlankLabel || v!== "";
// mark changed output port labels as dirty
if (node.type === "subflow" && node.outputLabels[index] !== v) {
if (node.type === "subflow" && (!node.outputLabels || node.outputLabels[index] !== v)) {
node.out[index].dirty = true;
}

View File

@ -3994,7 +3994,6 @@ RED.view = (function() {
subflowOutputs.exit().remove();
var outGroup = subflowOutputs.enter().insert("svg:g").attr("class","red-ui-flow-node red-ui-flow-subflow-port-output")
outGroup.each(function(d,i) {
var node = d3.select(this);
var nodeContents = document.createDocumentFragment();
@ -4020,6 +4019,7 @@ RED.view = (function() {
var output_groupEl = document.createElementNS("http://www.w3.org/2000/svg","g");
output_groupEl.setAttribute("x",0);
output_groupEl.setAttribute("y",0);
node[0][0].__outputLabelGroup__ = output_groupEl;
var output_output = document.createElementNS("http://www.w3.org/2000/svg","text");
output_output.setAttribute("class","red-ui-flow-port-label");
@ -4061,6 +4061,7 @@ RED.view = (function() {
port.setAttribute("width",10);
port.setAttribute("height",10);
portEl.appendChild(port);
port.__data__ = d;
d3.select(port)
.on("mousedown", function(d,i){portMouseDown(d,PORT_TYPE_INPUT,0);} )
@ -4206,9 +4207,8 @@ RED.view = (function() {
this.__outputBorder__.setAttribute("d","M 40 1 l 0 "+(hideLabel?0:(d.h - 2)));
this.__port__.setAttribute("transform","translate(-5,"+((d.h/2)-5)+")");
this.__outputNumber__.setAttribute("transform","translate(20,"+Math.max(28, (d.h/2)+2)+")");
this.__outputOutput__.setAttribute("transform","translate(20,"+Math.max(12, (d.h/2)-14)+")");
this.__outputOutput__.setAttribute("transform","translate(20,"+((d.h/2)-8)+")");
this.__outputNumber__.setAttribute("transform","translate(20,"+((d.h/2)+7)+")");
}
d.dirty = false;
}