diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js index a911e4c05..2bc932b8c 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-help.js @@ -233,7 +233,15 @@ RED.sidebar.help = (function() { var div = $('
',{class:"red-ui-info-outline-item"}); RED.utils.createNodeIcon(n).appendTo(div); var contentDiv = $('
',{class:"red-ui-search-result-description"}).appendTo(div); - $('
',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).text(n.name||n._def.paletteLabel||n.type).appendTo(contentDiv); + var label = n.name; + if (!label && n._def.paletteLabel) { + try { + label = (typeof n._def.paletteLabel === "function" ? n._def.paletteLabel.call(n._def) : n._def.paletteLabel)||""; + } catch (err) { + } + } + label = label || n.type; + $('
',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).text(label).appendTo(contentDiv); return div; } @@ -250,6 +258,13 @@ RED.sidebar.help = (function() { helpText = RED.nodes.getNodeHelp(nodeType)||(''+RED._("sidebar.info.none")+''); var _def = RED.nodes.registry.getNodeType(nodeType); title = (_def && _def.paletteLabel)?_def.paletteLabel:nodeType; + if (typeof title === "function") { + try { + title = _def.paletteLabel.call(_def); + } catch(err) { + title = nodeType; + } + } } setInfoText(title, helpText, helpSection);