mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Hide add-flow options when disabled via editorTheme
This commit is contained in:
parent
edc01552f9
commit
8c53d95610
@ -183,6 +183,7 @@ RED.workspaces = (function() {
|
|||||||
},
|
},
|
||||||
null)
|
null)
|
||||||
}
|
}
|
||||||
|
if (RED.settings.theme("menu.menu-item-workspace-add", true)) {
|
||||||
menuItems.push(
|
menuItems.push(
|
||||||
{
|
{
|
||||||
id:"red-ui-tabs-menu-option-add-flow",
|
id:"red-ui-tabs-menu-option-add-flow",
|
||||||
@ -190,7 +191,9 @@ RED.workspaces = (function() {
|
|||||||
onselect: "core:add-flow"
|
onselect: "core:add-flow"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
}
|
||||||
if (isMenuButton || !!tab) {
|
if (isMenuButton || !!tab) {
|
||||||
|
if (RED.settings.theme("menu.menu-item-workspace-add", true)) {
|
||||||
menuItems.push(
|
menuItems.push(
|
||||||
{
|
{
|
||||||
id:"red-ui-tabs-menu-option-add-flow-right",
|
id:"red-ui-tabs-menu-option-add-flow-right",
|
||||||
@ -202,6 +205,7 @@ RED.workspaces = (function() {
|
|||||||
},
|
},
|
||||||
null
|
null
|
||||||
)
|
)
|
||||||
|
}
|
||||||
if (activeWorkspace && activeWorkspace.type === 'tab') {
|
if (activeWorkspace && activeWorkspace.type === 'tab') {
|
||||||
menuItems.push(
|
menuItems.push(
|
||||||
isFlowDisabled ? {
|
isFlowDisabled ? {
|
||||||
@ -255,7 +259,9 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (menuItems.length > 0) {
|
||||||
menuItems.push(null)
|
menuItems.push(null)
|
||||||
|
}
|
||||||
if (isMenuButton || !!tab) {
|
if (isMenuButton || !!tab) {
|
||||||
menuItems.push(
|
menuItems.push(
|
||||||
{
|
{
|
||||||
@ -299,8 +305,10 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
if (tab) {
|
if (tab) {
|
||||||
|
menuItems.push(null)
|
||||||
|
|
||||||
|
if (RED.settings.theme("menu.menu-item-workspace-delete", true)) {
|
||||||
menuItems.push(
|
menuItems.push(
|
||||||
null,
|
|
||||||
{
|
{
|
||||||
label: RED._("common.label.delete"),
|
label: RED._("common.label.delete"),
|
||||||
onselect: function() {
|
onselect: function() {
|
||||||
@ -311,7 +319,10 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
disabled: isCurrentLocked || (workspaceTabCount === 1)
|
disabled: isCurrentLocked || (workspaceTabCount === 1)
|
||||||
},
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
menuItems.push(
|
||||||
{
|
{
|
||||||
label: RED._("menu.label.export"),
|
label: RED._("menu.label.export"),
|
||||||
shortcut: RED.keyboard.getShortcut("core:show-export-dialog"),
|
shortcut: RED.keyboard.getShortcut("core:show-export-dialog"),
|
||||||
@ -469,6 +480,7 @@ RED.workspaces = (function() {
|
|||||||
minimumActiveTabWidth: 150,
|
minimumActiveTabWidth: 150,
|
||||||
scrollable: true,
|
scrollable: true,
|
||||||
addButton: "core:add-flow",
|
addButton: "core:add-flow",
|
||||||
|
addButton: RED.settings.theme("menu.menu-item-workspace-add", true) ? "core:add-flow" : undefined,
|
||||||
addButtonCaption: RED._("workspace.addFlow"),
|
addButtonCaption: RED._("workspace.addFlow"),
|
||||||
menu: function() { return getMenuItems(true) },
|
menu: function() { return getMenuItems(true) },
|
||||||
contextmenu: function(tab) { return getMenuItems(false, tab) }
|
contextmenu: function(tab) { return getMenuItems(false, tab) }
|
||||||
@ -525,7 +537,7 @@ RED.workspaces = (function() {
|
|||||||
$(window).on("resize", function() {
|
$(window).on("resize", function() {
|
||||||
workspace_tabs.resize();
|
workspace_tabs.resize();
|
||||||
});
|
});
|
||||||
|
if (RED.settings.theme("menu.menu-item-workspace-add", true)) {
|
||||||
RED.actions.add("core:add-flow",function(opts) { addWorkspace(undefined,undefined,opts?opts.index:undefined)});
|
RED.actions.add("core:add-flow",function(opts) { addWorkspace(undefined,undefined,opts?opts.index:undefined)});
|
||||||
RED.actions.add("core:add-flow-to-right",function(workspace) {
|
RED.actions.add("core:add-flow-to-right",function(workspace) {
|
||||||
let index
|
let index
|
||||||
@ -536,8 +548,13 @@ RED.workspaces = (function() {
|
|||||||
}
|
}
|
||||||
addWorkspace(undefined,undefined,index)
|
addWorkspace(undefined,undefined,index)
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
if (RED.settings.theme("menu.menu-item-workspace-edit", true)) {
|
||||||
RED.actions.add("core:edit-flow",editWorkspace);
|
RED.actions.add("core:edit-flow",editWorkspace);
|
||||||
|
}
|
||||||
|
if (RED.settings.theme("menu.menu-item-workspace-delete", true)) {
|
||||||
RED.actions.add("core:remove-flow",removeWorkspace);
|
RED.actions.add("core:remove-flow",removeWorkspace);
|
||||||
|
}
|
||||||
RED.actions.add("core:enable-flow",enableWorkspace);
|
RED.actions.add("core:enable-flow",enableWorkspace);
|
||||||
RED.actions.add("core:disable-flow",disableWorkspace);
|
RED.actions.add("core:disable-flow",disableWorkspace);
|
||||||
RED.actions.add("core:lock-flow",lockWorkspace);
|
RED.actions.add("core:lock-flow",lockWorkspace);
|
||||||
|
@ -151,7 +151,8 @@
|
|||||||
&.red-ui-tabs-add {
|
&.red-ui-tabs-add {
|
||||||
padding-right: 29px;
|
padding-right: 29px;
|
||||||
}
|
}
|
||||||
&.red-ui-tabs-add.red-ui-tabs-scrollable {
|
&.red-ui-tabs-add.red-ui-tabs-scrollable,
|
||||||
|
&.red-ui-tabs-menu.red-ui-tabs-scrollable {
|
||||||
padding-right: 53px;
|
padding-right: 53px;
|
||||||
}
|
}
|
||||||
&.red-ui-tabs-add.red-ui-tabs-menu.red-ui-tabs-scrollable,
|
&.red-ui-tabs-add.red-ui-tabs-menu.red-ui-tabs-scrollable,
|
||||||
@ -310,7 +311,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
.red-ui-tabs.red-ui-tabs-add .red-ui-tab-scroll-right {
|
.red-ui-tabs.red-ui-tabs-add .red-ui-tab-scroll-right,
|
||||||
|
.red-ui-tabs.red-ui-tabs-menu .red-ui-tab-scroll-right {
|
||||||
right: 32px;
|
right: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user