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

Handle subflow type in refreshLabelForm

Part of #1955
This commit is contained in:
Nick O'Leary 2018-11-02 13:58:15 +00:00
parent 2e3fd49b40
commit e630919ef8
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -569,7 +569,13 @@ RED.editor = (function() {
var inputsDiv = $("#node-label-form-inputs"); var inputsDiv = $("#node-label-form-inputs");
var outputsDiv = $("#node-label-form-outputs"); var outputsDiv = $("#node-label-form-outputs");
var inputCount = node.inputs || node._def.inputs || 0; var inputCount;
if (node.type === 'subflow') {
inputCount = node.in.length;
} else {
inputCount = node.inputs || node._def.inputs || 0;
}
var children = inputsDiv.children(); var children = inputsDiv.children();
var childCount = children.length; var childCount = children.length;
if (childCount === 1 && $(children[0]).hasClass('node-label-form-none')) { if (childCount === 1 && $(children[0]).hasClass('node-label-form-none')) {
@ -598,7 +604,11 @@ RED.editor = (function() {
var formOutputs = $("#node-input-outputs").val(); var formOutputs = $("#node-input-outputs").val();
if (formOutputs === undefined) { if (formOutputs === undefined) {
outputCount = node.outputs || node._def.outputs || 0; if (node.type === 'subflow') {
outputCount = node.out.length;
} else {
inputCount = node.outputs || node._def.outputs || 0;
}
} else if (isNaN(formOutputs)) { } else if (isNaN(formOutputs)) {
var outputMap = JSON.parse(formOutputs); var outputMap = JSON.parse(formOutputs);
var keys = Object.keys(outputMap); var keys = Object.keys(outputMap);