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

Use paletteLabel if set in help sidebar

This commit is contained in:
Nick O'Leary 2021-04-19 21:07:44 +01:00
parent 73063df11b
commit b9ac8b42ea
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -233,7 +233,7 @@ RED.sidebar.help = (function() {
var div = $('<div>',{class:"red-ui-info-outline-item"}); var div = $('<div>',{class:"red-ui-info-outline-item"});
RED.utils.createNodeIcon(n).appendTo(div); RED.utils.createNodeIcon(n).appendTo(div);
var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div); var contentDiv = $('<div>',{class:"red-ui-search-result-description"}).appendTo(div);
$('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).text(n.name||n.type).appendTo(contentDiv); $('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).text(n.name||n._def.paletteLabel||n.type).appendTo(contentDiv);
return div; return div;
} }
@ -248,7 +248,8 @@ RED.sidebar.help = (function() {
title = subflowNode.name || nodeType; title = subflowNode.name || nodeType;
} else { } else {
helpText = RED.nodes.getNodeHelp(nodeType)||('<span class="red-ui-help-info-none">'+RED._("sidebar.info.none")+'</span>'); helpText = RED.nodes.getNodeHelp(nodeType)||('<span class="red-ui-help-info-none">'+RED._("sidebar.info.none")+'</span>');
title = nodeType; var _def = RED.nodes.registry.getNodeType(nodeType);
title = (_def && _def.paletteLabel)?_def.paletteLabel:nodeType;
} }
setInfoText(title, helpText, helpSection); setInfoText(title, helpText, helpSection);