Desktop: Fixes #2628: Disable Toggle Editor Layout Shortcut and Button in Empty Notebook (#2628)

* added toggleLayout logic

* added id

* improved code
pull/2728/head
Runo Saduwa 2020-03-07 00:27:32 +01:00 committed by GitHub
parent 9027f3fb10
commit bd6e77bf32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -963,6 +963,7 @@ class Application extends BaseApplication {
});
},
}, {
id: 'view:toggleLayout',
label: _('Toggle editor layout'),
screens: ['Main'],
accelerator: 'CommandOrControl+L',
@ -1185,6 +1186,8 @@ class Application extends BaseApplication {
menuItem.enabled = !isHtmlNote && layout !== 'viewer' && !!note;
}
const toggleLayout = Menu.getApplicationMenu().getMenuItemById('view:toggleLayout');
toggleLayout.enabled = !!note;
const menuItem = Menu.getApplicationMenu().getMenuItemById('help:toggleDevTools');
menuItem.checked = state.devToolsVisible;
}