From 1c66c88f95c6e385dec1d025572e5e470c3574fc Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Fri, 9 Nov 2018 09:51:55 +0100 Subject: [PATCH] Allow copy-to-clipboard copy whole tabs --- .../@node-red/editor-client/src/js/ui/view.js | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index ba270439c..82ec77c63 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -1471,10 +1471,24 @@ RED.view = (function() { } function copySelection() { - if (moving_set.length > 0) { + var nodes = []; + var selection = RED.workspaces.selection(); + if (selection.length > 0) { + nodes = []; + selection.forEach(function(n) { + if (n.type === 'tab') { + nodes.push(n); + nodes = nodes.concat(RED.nodes.filterNodes({z:n.id})); + } + }); + } else if (moving_set.length > 0) { + nodes = moving_set.map(function(n) { return n.n }); + } + + if (nodes.length > 0) { var nns = []; - for (var n=0;n