mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Avoid copying duplicate nodes to internal clipboard
This commit is contained in:
		@@ -2137,8 +2137,13 @@ RED.view = (function() {
 | 
				
			|||||||
            var nns = [];
 | 
					            var nns = [];
 | 
				
			||||||
            var nodeCount = 0;
 | 
					            var nodeCount = 0;
 | 
				
			||||||
            var groupCount = 0;
 | 
					            var groupCount = 0;
 | 
				
			||||||
 | 
					            var handled = {};
 | 
				
			||||||
            for (var n=0;n<nodes.length;n++) {
 | 
					            for (var n=0;n<nodes.length;n++) {
 | 
				
			||||||
                var node = nodes[n];
 | 
					                var node = nodes[n];
 | 
				
			||||||
 | 
					                if (handled[node.id]) {
 | 
				
			||||||
 | 
					                    continue;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                handled[node.id] = true;
 | 
				
			||||||
                // The only time a node.type == subflow can be selected is the
 | 
					                // The only time a node.type == subflow can be selected is the
 | 
				
			||||||
                // input/output "proxy" nodes. They cannot be copied.
 | 
					                // input/output "proxy" nodes. They cannot be copied.
 | 
				
			||||||
                if (node.type != "subflow") {
 | 
					                if (node.type != "subflow") {
 | 
				
			||||||
@@ -4874,6 +4879,9 @@ RED.view = (function() {
 | 
				
			|||||||
            if (n._def.button) {
 | 
					            if (n._def.button) {
 | 
				
			||||||
                nodeButtonClicked(n);
 | 
					                nodeButtonClicked(n);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        clipboard: function() {
 | 
				
			||||||
 | 
					            return clipboard
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
})();
 | 
					})();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user