',{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);