From 1d10eba0cce2c6351b082b06b315cfc9452d572a Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 20 Mar 2015 21:20:04 +0000 Subject: [PATCH] Propagate changed flag to parent subflow --- public/red/ui/editor.js | 11 ++++++++++- public/red/ui/view.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/public/red/ui/editor.js b/public/red/ui/editor.js index 11381f01b..378a46893 100644 --- a/public/red/ui/editor.js +++ b/public/red/ui/editor.js @@ -28,17 +28,22 @@ RED.editor = (function() { */ function validateNode(node) { var oldValue = node.valid; + var oldChanged = node.changed; node.valid = true; var subflow; var isValid; + var hasChanged; if (node.type.indexOf("subflow:")===0) { subflow = RED.nodes.subflow(node.type.substring(8)); isValid = subflow.valid; + hasChanged = subflow.changed; if (isValid === undefined) { isValid = validateNode(subflow); + hasChanged = subflow.changed; } node.valid = isValid; + node.changed = hasChanged; } else if (node._def) { node.valid = validateNodeProperties(node, node._def.defaults, node); if (node._def._creds) { @@ -48,15 +53,19 @@ RED.editor = (function() { var subflowNodes = RED.nodes.filterNodes({z:node.id}); for (var i=0;i