From a24c66958f0ba345e84f3b4f74b8c9b94c5e8111 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 6 Jun 2019 14:38:21 +0100 Subject: [PATCH] Fix display of node help when clicking in palette Fixes #2194 --- .../@node-red/editor-client/src/js/ui/palette.js | 5 ++++- .../@node-red/editor-client/src/js/ui/tab-info.js | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js index 645827d59..4e825f1b7 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/palette.js @@ -232,8 +232,11 @@ RED.palette = (function() { if (nt.indexOf("subflow:") === 0) { helpText = marked(RED.nodes.subflow(nt.substring(8)).info||"")||(''+RED._("sidebar.info.none")+''); } else { - helpText = $("script[data-help-name='"+d.type+"']").html()||(''+RED._("sidebar.info.none")+''); + helpText = $("script[data-help-name='"+d.attr("data-palette-type")+"']").html()||(''+RED._("sidebar.info.none")+''); } + // 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"); diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js index 209e527db..87a845466 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js @@ -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); }