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

Allow copy-to-clipboard copy whole tabs

This commit is contained in:
Nick O'Leary 2018-11-09 09:51:55 +01:00
parent dc880c672a
commit 1c66c88f95
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1471,10 +1471,24 @@ RED.view = (function() {
} }
function copySelection() { 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 = []; var nns = [];
for (var n=0;n<moving_set.length;n++) { for (var n=0;n<nodes.length;n++) {
var node = moving_set[n].n; var node = nodes[n];
// 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") {