mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28: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) => {
|
module.exports = (commandKeys, execCommand) => {
|
||||||
const submenu = [
|
const submenu = [
|
||||||
{
|
{
|
||||||
role: 'undo',
|
label: 'Undo',
|
||||||
accelerator: commandKeys['editor:undo']
|
accelerator: commandKeys['editor:undo'],
|
||||||
|
enabled: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
role: 'redo',
|
label: 'Redo',
|
||||||
accelerator: commandKeys['editor:redo']
|
accelerator: commandKeys['editor:redo'],
|
||||||
|
enabled: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
role: 'cut',
|
label: 'Cut',
|
||||||
accelerator: commandKeys['editor:cut']
|
accelerator: commandKeys['editor:cut'],
|
||||||
|
enabled: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
role: 'copy',
|
role: 'copy',
|
||||||
|
|
|
||||||
|
|
@ -21,5 +21,5 @@ const filterCutCopy = (selection, menuItem) => {
|
||||||
module.exports = (createWindow, selection) => {
|
module.exports = (createWindow, selection) => {
|
||||||
const _shell = shellMenu(commandKeys, execCommand).submenu;
|
const _shell = shellMenu(commandKeys, execCommand).submenu;
|
||||||
const _edit = editMenu(commandKeys, execCommand).submenu.filter(filterCutCopy.bind(null, selection));
|
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