mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Add an event for deletion hotkey
This commit is contained in:
@@ -61,6 +61,7 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
const reversedType = this.state.editorType === 'SPLIT' ? 'EDITOR_PREVIEW' : 'SPLIT'
|
const reversedType = this.state.editorType === 'SPLIT' ? 'EDITOR_PREVIEW' : 'SPLIT'
|
||||||
this.handleSwitchMode(reversedType)
|
this.handleSwitchMode(reversedType)
|
||||||
})
|
})
|
||||||
|
ee.on('hotkey:deletenote', this.handleDeleteNote.bind(this))
|
||||||
ee.on('code:generate-toc', this.generateToc)
|
ee.on('code:generate-toc', this.generateToc)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,6 +294,10 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleDeleteNote () {
|
||||||
|
this.handleTrashButtonClick()
|
||||||
|
}
|
||||||
|
|
||||||
renderEditor () {
|
renderEditor () {
|
||||||
const { config, ignorePreviewPointerEvents } = this.props
|
const { config, ignorePreviewPointerEvents } = this.props
|
||||||
const { note } = this.state
|
const { note } = this.state
|
||||||
|
|||||||
@@ -3,5 +3,8 @@ import ee from 'browser/main/lib/eventEmitter'
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
'toggleMode': () => {
|
'toggleMode': () => {
|
||||||
ee.emit('topbar:togglemodebutton')
|
ee.emit('topbar:togglemodebutton')
|
||||||
|
},
|
||||||
|
'deleteNote': () => {
|
||||||
|
ee.emit('hotkey:deletenote')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user