From d784889b75ef12eaf496530fa1954142e732921f Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 8 Apr 2014 15:32:58 +0100 Subject: [PATCH] Validate properties after calling oneditprepare --- public/red/ui/editor.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/red/ui/editor.js b/public/red/ui/editor.js index 3315d934a..46732894a 100644 --- a/public/red/ui/editor.js +++ b/public/red/ui/editor.js @@ -73,12 +73,17 @@ RED.editor = function() { } }; }()); - $("#node-input-"+d).change(); } } if (node._def.oneditprepare) { node._def.oneditprepare.call(node); } + if (node._def.defaults) { + for (var d in node._def.defaults) { + $("#node-input-"+d).change(); + } + } + $( "#dialog" ).dialog("option","title","Edit "+node.type+" node").dialog( "open" ); } @@ -479,6 +484,7 @@ RED.editor = function() { } }, close: function(e) { + $("#dialog-config-form").html(""); if (RED.view.state() != RED.state.EDITING) { RED.keyboard.enable(); }