From eb4cadb0b53768de028b8382571d11711921eb29 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 19 Mar 2015 23:11:55 +0000 Subject: [PATCH] Propagate valid flag to parent subflows --- public/red/history.js | 53 +++++++++++++++++++++++----------------- public/red/ui/editor.js | 47 +++++++++++++++++++++++++++++++---- public/red/ui/subflow.js | 1 + public/red/ui/view.js | 19 +++++++------- 4 files changed, 83 insertions(+), 37 deletions(-) diff --git a/public/red/history.js b/public/red/history.js index 2cdd2ae18..79c49ae1a 100644 --- a/public/red/history.js +++ b/public/red/history.js @@ -32,10 +32,16 @@ RED.history = (function() { pop: function() { var ev = undo_history.pop(); var i; + var node; + var modifiedTabs = {}; if (ev) { if (ev.t == 'add') { if (ev.nodes) { for (i=0;i n.ports.length) { - n.ports.push(n.ports.length); - } - n.resize = true; - n.dirty = true; + RED.nodes.filterNodes({type:"subflow:"+subflow.id}).forEach(function(n) { + n.changed = true; + n.inputs = subflow.in.length; + n.outputs = subflow.out.length; + while (n.outputs > n.ports.length) { + n.ports.push(n.ports.length); } + n.resize = true; + n.dirty = true; }); } if (ev.nodes) { for (i=0;i