1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Handle null subflow info property

This commit is contained in:
Nick O'Leary 2015-10-26 11:12:21 +00:00
parent 425b016d63
commit 20b321f928
2 changed files with 4 additions and 4 deletions

View File

@ -203,7 +203,7 @@ RED.palette = (function() {
RED.view.focus();
var helpText;
if (nt.indexOf("subflow:") === 0) {
helpText = marked(RED.nodes.subflow(nt.substring(8)).info) || "";
helpText = marked(RED.nodes.subflow(nt.substring(8)).info||"");
} else {
helpText = $("script[data-help-name|='"+d.type+"']").html()||"";
}
@ -224,7 +224,7 @@ RED.palette = (function() {
RED.workspaces.show(nt.substring(8));
e.preventDefault();
});
nodeInfo = marked(def.info);
nodeInfo = marked(def.info||"");
}
setLabel(nt,$(d),label,nodeInfo);
@ -279,7 +279,7 @@ RED.palette = (function() {
} else if (portOutput.length !== 0 && sf.out.length === 0) {
portOutput.remove();
}
setLabel(sf.type+":"+sf.id,paletteNode,sf.name,marked(sf.info));
setLabel(sf.type+":"+sf.id,paletteNode,sf.name,marked(sf.info||""));
});
}

View File

@ -140,7 +140,7 @@ RED.sidebar.info = (function() {
table += '<div class="node-help">'+helpText+"</div>";
}
if (subflowNode) {
table += '<div class="node-help">'+marked(subflowNode.info)+'</div>';
table += '<div class="node-help">'+marked(subflowNode.info||"")+'</div>';
} else if (node._def && node._def.info) {
var info = node._def.info;
table += '<div class="node-help">'+marked(typeof info === "function" ? info.call(node) : info)+'</div>';