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

Merge pull request #3200 from node-red/fix-link-call-label

Fix link call label
This commit is contained in:
Nick O'Leary 2021-10-14 12:04:25 +01:00 committed by GitHub
commit 2b38b5ea50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View File

@ -4006,10 +4006,10 @@ RED.view = (function() {
var labelParts;
if (d.resize || this.__hideLabel__ !== hideLabel || this.__label__ !== label || this.__outputs__.length !== d.outputs) {
labelParts = getLabelParts(label, "red-ui-flow-node-label");
this.__label__ = label;
if (labelParts.lines.length !== this.__labelLineCount__) {
if (labelParts.lines.length !== this.__labelLineCount__ || this.__label__ !== label) {
d.resize = true;
}
this.__label__ = label;
this.__labelLineCount__ = labelParts.lines.length;
if (hideLabel) {

View File

@ -242,6 +242,12 @@
},
oneditsave: function() {
onEditSave(this);
// In case the name has changed, ensure any link call nodes on this
// tab are redrawn with the updated name
var localCallNodes = RED.nodes.filterNodes({z:RED.workspaces.active(), type:"link call"});
localCallNodes.forEach(function(node) {
node.dirty = true;
});
},
onadd: onAdd,
oneditresize: resizeNodeList
@ -267,12 +273,12 @@
}
if (this.links.length > 0) {
var targetNode = RED.nodes.node(this.links[0]);
return targetNode && (targetNode.name || targetNode.id);
return targetNode && (targetNode.name || this._("link.linkCall"));
}
return this._("link.linkCall");
return this._("inject.none");
},
labelStyle: function() {
return (this.name || this.links.length > 0)?"node_label_italic":"";
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
onEditPrepare(this,"link in");
@ -283,7 +289,6 @@
oneditresize: resizeNodeList
});
RED.nodes.registerType('link out',{
category: 'common',
color:"#ddd",//"#87D8CF",