mirror of https://github.com/node-red/node-red.git
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.pull/518/merge
parent
f6f4b0784b
commit
462c259f3a
|
@ -94,6 +94,12 @@ RED.sidebar.info = (function() {
|
|||
table += "</tbody></table><br/>";
|
||||
var helpText = $("script[data-help-name|='"+node.type+"']").html()||"";
|
||||
table += '<div class="node-help">'+helpText+"</div>";
|
||||
|
||||
if (node._def.info) {
|
||||
var info = node._def.info;
|
||||
table += '<div class="node-help">'+(typeof info === "function" ? info.call(node) : info)+'</div>';
|
||||
}
|
||||
|
||||
$("#tab-info").html(table);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue