mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Ensure link call node label updates when link-in changes
This commit is contained in:
		@@ -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",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user