mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Merge pull request #4633 from node-red/4617-hide-library-context-options
Hide import/export context menu if disabled in theme
This commit is contained in:
		| @@ -118,10 +118,16 @@ RED.contextMenu = (function () { | ||||
|                     onselect: 'core:split-wire-with-link-nodes', | ||||
|                     disabled: !canEdit || !hasLinks | ||||
|                 }, | ||||
|                 null, | ||||
|                 { onselect: 'core:show-import-dialog', label: RED._('common.label.import')}, | ||||
|                 { onselect: 'core:show-examples-import-dialog', label: RED._('menu.label.importExample') } | ||||
|                 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-examples-import-dialog', label: RED._('menu.label.importExample') } | ||||
|                 ) | ||||
|             } | ||||
|  | ||||
|  | ||||
|             if (hasSelection && canEdit) { | ||||
|                 const nodeOptions = [] | ||||
|                 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:delete-selection', label: RED._('keyboard.deleteSelected'), 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") } | ||||
|             ) | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user