mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 20:50:41 +08:00
Fix sidebar and tabbar won't toggle (#557)
This commit is contained in:
parent
4789c7b119
commit
d0c4763e7e
@ -69,7 +69,12 @@ let viewMenu = {
|
|||||||
accelerator: keybindings.getAccelerator('viewToggleSideBar'),
|
accelerator: keybindings.getAccelerator('viewToggleSideBar'),
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
checked: false,
|
checked: false,
|
||||||
click (item, browserWindow) {
|
click (item, browserWindow, event) {
|
||||||
|
// if we call this function, the checked state is not set
|
||||||
|
if (!event) {
|
||||||
|
item.checked = !item.checked
|
||||||
|
}
|
||||||
|
|
||||||
actions.layout(item, browserWindow, 'showSideBar')
|
actions.layout(item, browserWindow, 'showSideBar')
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -78,7 +83,12 @@ let viewMenu = {
|
|||||||
accelerator: keybindings.getAccelerator('viewToggleTabBar'),
|
accelerator: keybindings.getAccelerator('viewToggleTabBar'),
|
||||||
type: 'checkbox',
|
type: 'checkbox',
|
||||||
checked: false,
|
checked: false,
|
||||||
click (item, browserWindow) {
|
click (item, browserWindow, event) {
|
||||||
|
// if we call this function, the checked state is not set
|
||||||
|
if (!event) {
|
||||||
|
item.checked = !item.checked
|
||||||
|
}
|
||||||
|
|
||||||
actions.layout(item, browserWindow, 'showTabBar')
|
actions.layout(item, browserWindow, 'showTabBar')
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
Loading…
Reference in New Issue
Block a user