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

Fix display of node help when clicking in palette

Fixes #2194
This commit is contained in:
Nick O'Leary 2019-06-06 14:38:21 +01:00
parent 617628b886
commit a24c66958f
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 6 additions and 2 deletions

View File

@ -232,8 +232,11 @@ RED.palette = (function() {
if (nt.indexOf("subflow:") === 0) {
helpText = marked(RED.nodes.subflow(nt.substring(8)).info||"")||('<span class="red-ui-help-info-none">'+RED._("sidebar.info.none")+'</span>');
} else {
helpText = $("script[data-help-name='"+d.type+"']").html()||('<span class="red-ui-help-info-none">'+RED._("sidebar.info.none")+'</span>');
helpText = $("script[data-help-name='"+d.attr("data-palette-type")+"']").html()||('<span class="red-ui-help-info-none">'+RED._("sidebar.info.none")+'</span>');
}
// Don't look too closely. RED.sidebar.info.set will set the 'Description'
// section of the sidebar. Pass in the title of the Help section so it looks
// right.
RED.sidebar.info.set(helpText,RED._("sidebar.info.nodeHelp"));
});
var chart = $("#red-ui-workspace-chart");

View File

@ -128,6 +128,7 @@ RED.sidebar.info = (function() {
$(propertiesSection.content).empty();
$(infoSection.content).empty();
$(helpSection.content).empty();
infoSection.title.text(RED._("sidebar.info.desc"));
var propRow;
@ -464,7 +465,7 @@ RED.sidebar.info = (function() {
propertiesSection.container.hide();
helpSection.container.hide();
infoSection.container.show();
//helpSection.title.text(title||RED._("sidebar.info.info"));
infoSection.title.text(title||RED._("sidebar.info.desc"));
setInfoText(html,infoSection.content);
$(".red-ui-sidebar-info-stack").scrollTop(0);
}