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

Changing subflow in/outs leaving wires behind

Fixes #477
This commit is contained in:
Nick O'Leary 2014-11-07 11:22:00 +00:00
parent 3e235ecc0b
commit e7dccf04d2
2 changed files with 6 additions and 4 deletions

View File

@ -750,8 +750,8 @@ RED.editor = (function() {
var wasDirty = RED.view.dirty();
var newName = $("#subflow-input-name").val();
var newInCount = $("#subflow-input-inCount").val();
var newOutCount = $("#subflow-input-outCount").val();
var newInCount = Number($("#subflow-input-inCount").val())||0;
var newOutCount = Number($("#subflow-input-outCount").val())||0;
var oldInCount = editing_node.in.length;
var oldOutCount = editing_node.out.length;

View File

@ -2016,20 +2016,22 @@ RED.view = (function() {
type:"subflow",
id:subflowId,
name:name,
in: candidateInputs.map(function(v,i) { return {
in: candidateInputs.map(function(v,i) { var index = i; return {
type:"subflow",
direction:"in",
x:v.target.x-(v.target.w/2)-80,
y:v.target.y,
z:subflowId,
i:index,
wires:[{id:v.target.id}]
}}),
out: candidateOutputs.map(function(v) { return {
out: candidateOutputs.map(function(v,i) { var index = i; return {
type:"subflow",
direction:"in",
x:v.source.x+(v.source.w/2)+80,
y:v.source.y,
z:subflowId,
i:index,
wires:[{id:v.source.id,port:v.sourcePort}]
}})
};