mirror of https://github.com/node-red/node-red.git
Merge pull request #5106 from node-red/5090-fix-label-action
Handle link nodes with show/hide label actionpull/4887/merge
commit
833687fd55
|
@ -46,10 +46,20 @@ RED.contextMenu = (function () {
|
||||||
hasEnabledNode = true;
|
hasEnabledNode = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (n.l === undefined || n.l) {
|
if (n.l === undefined) {
|
||||||
hasLabeledNode = true;
|
// Check if the node sets showLabel in the defaults
|
||||||
|
// as that determines the default behaviour for the node
|
||||||
|
if (n._def.showLabel !== false) {
|
||||||
|
hasLabeledNode = true;
|
||||||
|
} else {
|
||||||
|
hasUnlabeledNode = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
hasUnlabeledNode = true;
|
if (n.l) {
|
||||||
|
hasLabeledNode = true;
|
||||||
|
} else {
|
||||||
|
hasUnlabeledNode = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,8 +176,8 @@ RED.view.tools = (function() {
|
||||||
}
|
}
|
||||||
nodes.forEach(function(n) {
|
nodes.forEach(function(n) {
|
||||||
var modified = false;
|
var modified = false;
|
||||||
var oldValue = n.l === undefined?true:n.l;
|
var showLabel = n._def.hasOwnProperty("showLabel") ? n._def.showLabel : true;
|
||||||
var showLabel = n._def.hasOwnProperty("showLabel")?n._def.showLabel:true;
|
var oldValue = n.l === undefined ? showLabel : n.l;
|
||||||
|
|
||||||
if (labelShown) {
|
if (labelShown) {
|
||||||
if (n.l === false || (!showLabel && !n.hasOwnProperty('l'))) {
|
if (n.l === false || (!showLabel && !n.hasOwnProperty('l'))) {
|
||||||
|
|
Loading…
Reference in New Issue