mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Move a shortcut escapeFromCodeEditor from CodeEditor to MarkdownEditor, because it's not customizable
This commit is contained in:
@@ -8,7 +8,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
this.hotkey = props.config.hotkey
|
this.escapeFromEditor = ['Control', 'w']
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
status: 'PREVIEW',
|
status: 'PREVIEW',
|
||||||
@@ -152,7 +152,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
})
|
})
|
||||||
this.setState({ keyPressed })
|
this.setState({ keyPressed })
|
||||||
let isNoteHandlerKey = (el) => { return this.state.keyPressed[el] }
|
let isNoteHandlerKey = (el) => { return this.state.keyPressed[el] }
|
||||||
if (this.state.status === 'CODE' && this.hotkey.noteHandlerKey.escapeFromEditor.every(isNoteHandlerKey)) {
|
if (this.state.status === 'CODE' && this.escapeFromEditor.every(isNoteHandlerKey)) {
|
||||||
document.activeElement.blur()
|
document.activeElement.blur()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,6 @@ export const DEFAULT_CONFIG = {
|
|||||||
hotkey: {
|
hotkey: {
|
||||||
toggleFinder: OSX ? 'Cmd + Alt + S' : 'Super + Alt + S',
|
toggleFinder: OSX ? 'Cmd + Alt + S' : 'Super + Alt + S',
|
||||||
toggleMain: OSX ? 'Cmd + Alt + L' : 'Super + Alt + E',
|
toggleMain: OSX ? 'Cmd + Alt + L' : 'Super + Alt + E',
|
||||||
noteHandlerKey: {
|
|
||||||
escapeFromEditor: ['Control', 'w']
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
ui: {
|
ui: {
|
||||||
theme: 'default',
|
theme: 'default',
|
||||||
|
|||||||
Reference in New Issue
Block a user