mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Hide import/export context menu if disabled in theme
This commit is contained in:
parent
37265cf4ef
commit
9526566799
@ -118,10 +118,16 @@ RED.contextMenu = (function () {
|
|||||||
onselect: 'core:split-wire-with-link-nodes',
|
onselect: 'core:split-wire-with-link-nodes',
|
||||||
disabled: !canEdit || !hasLinks
|
disabled: !canEdit || !hasLinks
|
||||||
},
|
},
|
||||||
null,
|
null
|
||||||
|
)
|
||||||
|
if (RED.settings.theme("menu.menu-item-import-library", true)) {
|
||||||
|
insertOptions.push(
|
||||||
{ onselect: 'core:show-import-dialog', label: RED._('common.label.import')},
|
{ onselect: 'core:show-import-dialog', label: RED._('common.label.import')},
|
||||||
{ onselect: 'core:show-examples-import-dialog', label: RED._('menu.label.importExample') }
|
{ onselect: 'core:show-examples-import-dialog', label: RED._('menu.label.importExample') }
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (hasSelection && canEdit) {
|
if (hasSelection && canEdit) {
|
||||||
const nodeOptions = []
|
const nodeOptions = []
|
||||||
if (!hasMultipleSelection && !isGroup) {
|
if (!hasMultipleSelection && !isGroup) {
|
||||||
@ -194,8 +200,14 @@ RED.contextMenu = (function () {
|
|||||||
{ onselect: 'core:paste-from-internal-clipboard', label: RED._("keyboard.pasteNode"), disabled: !canEdit || !RED.view.clipboard() },
|
{ onselect: 'core:paste-from-internal-clipboard', label: RED._("keyboard.pasteNode"), disabled: !canEdit || !RED.view.clipboard() },
|
||||||
{ onselect: 'core:delete-selection', label: RED._('keyboard.deleteSelected'), disabled: !canEdit || !canDelete },
|
{ onselect: 'core:delete-selection', label: RED._('keyboard.deleteSelected'), disabled: !canEdit || !canDelete },
|
||||||
{ onselect: 'core:delete-selection-and-reconnect', label: RED._('keyboard.deleteReconnect'), disabled: !canEdit || !canDelete },
|
{ onselect: 'core:delete-selection-and-reconnect', label: RED._('keyboard.deleteReconnect'), disabled: !canEdit || !canDelete },
|
||||||
{ onselect: 'core:show-export-dialog', label: RED._("menu.label.export") },
|
)
|
||||||
{ onselect: 'core:select-all-nodes', label: RED._("keyboard.selectAll") },
|
if (RED.settings.theme("menu.menu-item-export-library", true)) {
|
||||||
|
menuItems.push(
|
||||||
|
{ onselect: 'core:show-export-dialog', label: RED._("menu.label.export") }
|
||||||
|
)
|
||||||
|
}
|
||||||
|
menuItems.push(
|
||||||
|
{ onselect: 'core:select-all-nodes', label: RED._("keyboard.selectAll") }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user