mirror of
https://github.com/marktext/marktext.git
synced 2025-05-03 00:51:26 +08:00

* Refactor menu actions and shortcut handling * Remove duplicated command id * Update docs
21 lines
405 B
JavaScript
21 lines
405 B
JavaScript
import { app, Menu } from 'electron'
|
|
import * as actions from '../actions/file'
|
|
|
|
const dockMenu = Menu.buildFromTemplate([{
|
|
label: 'Open...',
|
|
click (menuItem, browserWindow) {
|
|
if (browserWindow) {
|
|
actions.openFile(browserWindow)
|
|
} else {
|
|
actions.newEditorWindow()
|
|
}
|
|
}
|
|
}, {
|
|
label: 'Clear Recent',
|
|
click () {
|
|
app.clearRecentDocuments()
|
|
}
|
|
}])
|
|
|
|
export default dockMenu
|