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

Disable copy/paste and enable select-all in node-select mode

This commit is contained in:
Nick O'Leary 2019-05-23 16:48:07 +01:00
parent 502a8112b5
commit 20cba6411b
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -1388,14 +1388,19 @@ RED.view = (function() {
function selectAll() {
RED.nodes.eachNode(function(n) {
if (n.z == RED.workspaces.active()) {
if (!n.selected) {
n.selected = true;
n.dirty = true;
moving_set.push({n:n});
if (mouse_mode === RED.state.SELECTING_NODE) {
if (selectNodesOptions.filter && !selectNodesOptions.filter(n)) {
return;
}
}
}
if (!n.selected) {
n.selected = true;
n.dirty = true;
moving_set.push({n:n});
}
});
if (activeSubflow) {
if (mouse_mode !== RED.state.SELECTING_NODE && activeSubflow) {
activeSubflow.in.forEach(function(n) {
if (!n.selected) {
n.selected = true;
@ -1420,7 +1425,9 @@ RED.view = (function() {
}
selected_link = null;
updateSelection();
if (mouse_mode !== RED.state.SELECTING_NODE) {
updateSelection();
}
redraw();
}
@ -1554,6 +1561,9 @@ RED.view = (function() {
}
}
function deleteSelection() {
if (mouse_mode === RED.state.SELECTING_NODE) {
return;
}
if (portLabelHover) {
portLabelHover.remove();
portLabelHover = null;
@ -1730,6 +1740,9 @@ RED.view = (function() {
}
function copySelection() {
if (mouse_mode === RED.state.SELECTING_NODE) {
return;
}
var nodes = [];
var selection = RED.workspaces.selection();
if (selection.length > 0) {
@ -3378,6 +3391,9 @@ RED.view = (function() {
* - attached to mouse for placing - "IMPORT_DRAGGING"
*/
function importNodes(newNodesStr,addNewFlow,touchImport) {
if (mouse_mode === RED.state.SELECTING_NODE) {
return;
}
try {
var activeSubflowChanged;
if (activeSubflow) {