mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Disable undo/redo/cut menuItems (#2435)
This commit is contained in:
parent
0f4c41f89a
commit
c62e042535
2 changed files with 10 additions and 7 deletions
|
|
@ -1,19 +1,22 @@
|
|||
module.exports = (commandKeys, execCommand) => {
|
||||
const submenu = [
|
||||
{
|
||||
role: 'undo',
|
||||
accelerator: commandKeys['editor:undo']
|
||||
label: 'Undo',
|
||||
accelerator: commandKeys['editor:undo'],
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
role: 'redo',
|
||||
accelerator: commandKeys['editor:redo']
|
||||
label: 'Redo',
|
||||
accelerator: commandKeys['editor:redo'],
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
type: 'separator'
|
||||
},
|
||||
{
|
||||
role: 'cut',
|
||||
accelerator: commandKeys['editor:cut']
|
||||
label: 'Cut',
|
||||
accelerator: commandKeys['editor:cut'],
|
||||
enabled: false
|
||||
},
|
||||
{
|
||||
role: 'copy',
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ const filterCutCopy = (selection, menuItem) => {
|
|||
module.exports = (createWindow, selection) => {
|
||||
const _shell = shellMenu(commandKeys, execCommand).submenu;
|
||||
const _edit = editMenu(commandKeys, execCommand).submenu.filter(filterCutCopy.bind(null, selection));
|
||||
return _edit.concat(separator, _shell);
|
||||
return _edit.concat(separator, _shell).filter(menuItem => !menuItem.hasOwnProperty('enabled') || menuItem.enabled);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue