mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
b0e4fb7602
commit
635bdf15cb
@ -233,7 +233,15 @@ 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._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;
|
||||||
|
$('<div>',{class:"red-ui-search-result-node-label red-ui-info-outline-item-label"}).text(label).appendTo(contentDiv);
|
||||||
return div;
|
return div;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,6 +258,13 @@ RED.sidebar.help = (function() {
|
|||||||
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>');
|
||||||
var _def = RED.nodes.registry.getNodeType(nodeType);
|
var _def = RED.nodes.registry.getNodeType(nodeType);
|
||||||
title = (_def && _def.paletteLabel)?_def.paletteLabel: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);
|
setInfoText(title, helpText, helpSection);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user