mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Ensure info tab sections are collapsible when set from palette
This commit is contained in:
parent
6a6a692891
commit
6bd59b10c7
@ -210,8 +210,7 @@ RED.palette = (function() {
|
|||||||
} 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>";
|
RED.sidebar.info.set(helpText);
|
||||||
RED.sidebar.info.set(help);
|
|
||||||
});
|
});
|
||||||
var chart = $("#chart");
|
var chart = $("#chart");
|
||||||
var chartOffset = chart.offset();
|
var chartOffset = chart.offset();
|
||||||
|
@ -233,6 +233,18 @@ RED.sidebar.info = (function() {
|
|||||||
infoText = infoText + marked(textInfo);
|
infoText = infoText + marked(textInfo);
|
||||||
}
|
}
|
||||||
if (infoText) {
|
if (infoText) {
|
||||||
|
setInfoText(infoText);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$(".node-info-property-header").click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
expandedSections["property"] = !expandedSections["property"];
|
||||||
|
$(this).toggleClass("expanded",expandedSections["property"]);
|
||||||
|
$(".node-info-property-row").toggle(expandedSections["property"]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function setInfoText(infoText) {
|
||||||
var info = addTargetToExternalLinks($('<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(infoText)+'">'+infoText+'</span></div>')).appendTo(infoSection.content);
|
var info = addTargetToExternalLinks($('<div class="node-help"><span class="bidiAware" dir=\"'+RED.text.bidi.resolveBaseTextDir(infoText)+'">'+infoText+'</span></div>')).appendTo(infoSection.content);
|
||||||
info.find(".bidiAware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
|
info.find(".bidiAware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "<span></span>" );
|
||||||
var foldingHeader = "H3";
|
var foldingHeader = "H3";
|
||||||
@ -248,17 +260,6 @@ RED.sidebar.info = (function() {
|
|||||||
$(this).toggleClass('expanded',!isExpanded);
|
$(this).toggleClass('expanded',!isExpanded);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(".node-info-property-header").click(function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
expandedSections["property"] = !expandedSections["property"];
|
|
||||||
$(this).toggleClass("expanded",expandedSections["property"]);
|
|
||||||
$(".node-info-property-row").toggle(expandedSections["property"]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var tips = (function() {
|
var tips = (function() {
|
||||||
var enabled = true;
|
var enabled = true;
|
||||||
var startDelay = 1000;
|
var startDelay = 1000;
|
||||||
@ -349,8 +350,8 @@ RED.sidebar.info = (function() {
|
|||||||
// tips.stop();
|
// tips.stop();
|
||||||
sections.show();
|
sections.show();
|
||||||
nodeSection.container.hide();
|
nodeSection.container.hide();
|
||||||
var wrapped = $('<div class="node-help"></div>').html(html);
|
$(infoSection.content).empty();
|
||||||
$(infoSection.content).empty().append(wrapped);
|
setInfoText(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user