mirror of https://github.com/node-red/node-red.git
Handle link nodes with show/hide label action
parent
71501dd6aa
commit
2c71e11fbf
|
@ -46,10 +46,20 @@ RED.contextMenu = (function () {
|
|||
hasEnabledNode = true;
|
||||
}
|
||||
}
|
||||
if (n.l === undefined || n.l) {
|
||||
hasLabeledNode = true;
|
||||
if (n.l === undefined) {
|
||||
// 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 {
|
||||
hasUnlabeledNode = true;
|
||||
if (n.l) {
|
||||
hasLabeledNode = true;
|
||||
} else {
|
||||
hasUnlabeledNode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,8 +176,8 @@ RED.view.tools = (function() {
|
|||
}
|
||||
nodes.forEach(function(n) {
|
||||
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 (n.l === false || (!showLabel && !n.hasOwnProperty('l'))) {
|
||||
|
|
Loading…
Reference in New Issue