mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Disable subflow/flow menu options if active is locked
This commit is contained in:
parent
f12d36b5ed
commit
ce94226c3c
@ -554,7 +554,7 @@ RED.subflow = (function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
RED.events.on("view:selection-changed",function(selection) {
|
RED.events.on("view:selection-changed",function(selection) {
|
||||||
if (!selection.nodes) {
|
if (!selection.nodes || RED.workspaces.isActiveLocked()) {
|
||||||
RED.menu.setDisabled("menu-item-subflow-convert",true);
|
RED.menu.setDisabled("menu-item-subflow-convert",true);
|
||||||
} else {
|
} else {
|
||||||
RED.menu.setDisabled("menu-item-subflow-convert",false);
|
RED.menu.setDisabled("menu-item-subflow-convert",false);
|
||||||
|
@ -423,8 +423,8 @@ RED.view = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RED.menu.setDisabled("menu-item-workspace-edit", activeSubflow || event.workspace === 0);
|
RED.menu.setDisabled("menu-item-workspace-edit", activeFlowLocked || activeSubflow || event.workspace === 0);
|
||||||
RED.menu.setDisabled("menu-item-workspace-delete",event.workspace === 0 || RED.workspaces.count() == 1 || activeSubflow);
|
RED.menu.setDisabled("menu-item-workspace-delete",activeFlowLocked || event.workspace === 0 || RED.workspaces.count() == 1 || activeSubflow);
|
||||||
|
|
||||||
if (workspaceScrollPositions[event.workspace]) {
|
if (workspaceScrollPositions[event.workspace]) {
|
||||||
chart.scrollLeft(workspaceScrollPositions[event.workspace].left);
|
chart.scrollLeft(workspaceScrollPositions[event.workspace].left);
|
||||||
|
@ -724,11 +724,13 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function removeWorkspace(ws) {
|
function removeWorkspace(ws) {
|
||||||
if (ws.locked) { return }
|
|
||||||
|
|
||||||
if (!ws) {
|
if (!ws) {
|
||||||
|
ws = RED.nodes.workspace(activeWorkspace)
|
||||||
|
if (ws && !ws.locked) {
|
||||||
deleteWorkspace(RED.nodes.workspace(activeWorkspace));
|
deleteWorkspace(RED.nodes.workspace(activeWorkspace));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (ws.locked) { return }
|
||||||
if (workspace_tabs.contains(ws.id)) {
|
if (workspace_tabs.contains(ws.id)) {
|
||||||
workspace_tabs.removeTab(ws.id);
|
workspace_tabs.removeTab(ws.id);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user