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

Fix jquery selector, selecting more than one help pane/popover and displaying incorrectly. (#970)

This commit is contained in:
telogis-nodered 2016-08-25 21:44:23 +12:00 committed by Nick O'Leary
parent 9ebca91775
commit 2a2fc80931
2 changed files with 3 additions and 3 deletions

View File

@ -101,7 +101,7 @@ RED.palette = (function() {
if (label != type) { if (label != type) {
l = "<p><b>"+label+"</b><br/><i>"+type+"</i></p>"; l = "<p><b>"+label+"</b><br/><i>"+type+"</i></p>";
} }
popOverContent = $(l+(info?info:$("script[data-help-name|='"+type+"']").html()||"<p>"+RED._("palette.noInfo")+"</p>").trim()) popOverContent = $(l+(info?info:$("script[data-help-name$='"+type+"']").html()||"<p>"+RED._("palette.noInfo")+"</p>").trim())
.filter(function(n) { .filter(function(n) {
return (this.nodeType == 1 && this.nodeName == "P") || (this.nodeType == 3 && this.textContent.trim().length > 0) return (this.nodeType == 1 && this.nodeName == "P") || (this.nodeType == 3 && this.textContent.trim().length > 0)
}).slice(0,2); }).slice(0,2);
@ -210,7 +210,7 @@ RED.palette = (function() {
if (nt.indexOf("subflow:") === 0) { if (nt.indexOf("subflow:") === 0) {
helpText = marked(RED.nodes.subflow(nt.substring(8)).info||""); helpText = marked(RED.nodes.subflow(nt.substring(8)).info||"");
} else { } else {
helpText = $("script[data-help-name|='"+d.type+"']").html()||""; helpText = $("script[data-help-name$='"+d.type+"']").html()||"";
} }
var help = '<div class="node-help">'+helpText+"</div>"; var help = '<div class="node-help">'+helpText+"</div>";
RED.sidebar.info.set(help); RED.sidebar.info.set(help);

View File

@ -139,7 +139,7 @@ RED.sidebar.info = (function() {
} }
table += "</tbody></table><hr/>"; table += "</tbody></table><hr/>";
if (!subflowNode && node.type != "comment") { if (!subflowNode && node.type != "comment") {
var helpText = $("script[data-help-name|='"+node.type+"']").html()||""; var helpText = $("script[data-help-name$='"+node.type+"']").html()||"";
table += '<div class="node-help">'+helpText+"</div>"; table += '<div class="node-help">'+helpText+"</div>";
} }
if (subflowNode) { if (subflowNode) {