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

info instead of tooltip

This commit is contained in:
Gerwin van Beek 2022-06-16 17:19:37 +02:00
parent 5494b06311
commit 5e23920c43

View File

@ -3663,19 +3663,13 @@ RED.view = (function() {
clearTimeout(portLabelHoverTimeout); clearTimeout(portLabelHoverTimeout);
var displayLabel = d.hasOwnProperty('l')?!d.l : (d.type === "link in" || d.type === "link out"); var displayLabel = d.hasOwnProperty('l')?!d.l : (d.type === "link in" || d.type === "link out");
if (displayLabel || d._def.tooltip) { if (displayLabel || d.info) {
var parentNode = this.parentNode; var parentNode = this.parentNode;
portLabelHoverTimeout = setTimeout(function() { portLabelHoverTimeout = setTimeout(function() {
var tooltip; var tooltip;
try { try {
if (d._def.tooltip) { var label = displayLabel ? (typeof d._def.label === "function" ? d._def.label.call(d) : d._def.label)||"" : "";
tooltip = d._def.tooltip; tooltip = `${label ? label : ''}${d.info && label ? ': ': ''}${d.info ? d.info : ''}`;
tooltip = (typeof tooltip === "function" ? tooltip.call(d) : tooltip)||"";
}
if (displayLabel && d._def.label && !tooltip){
tooltip = d._def.label;
tooltip = (typeof tooltip === "function" ? tooltip.call(d) : tooltip)||"";
}
} catch(err) { } catch(err) {
console.log("Definition error: "+d.type+".label",err); console.log("Definition error: "+d.type+".label",err);
tooltip = d.type; tooltip = d.type;