From 110f0bf16966fcdeae6cfd23146e235745c98527 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sat, 17 Jan 2015 21:36:16 +0000 Subject: [PATCH] Allow node to provide dynamic content to Info tab Closes #492 The node definition can now include an `info` property. This property can be either a string or a Function. Whenever the info tab is refreshed, such as the node is selected, the value of this property, or the result of the Function, will be appended to the Info tab. --- public/red/ui/tab-info.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/red/ui/tab-info.js b/public/red/ui/tab-info.js index 9aa194872..9d5b241d9 100644 --- a/public/red/ui/tab-info.js +++ b/public/red/ui/tab-info.js @@ -94,6 +94,12 @@ RED.sidebar.info = (function() { table += "
"; var helpText = $("script[data-help-name|='"+node.type+"']").html()||""; table += '
'+helpText+"
"; + + if (node._def.info) { + var info = node._def.info; + table += '
'+(typeof info === "function" ? info.call(node) : info)+'
'; + } + $("#tab-info").html(table); }