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