From ad9da44afbb4d0ebda1871a4b02593a7d86a70e7 Mon Sep 17 00:00:00 2001 From: asmsuechan Date: Sat, 28 Jan 2017 13:27:06 +0900 Subject: [PATCH] Move a shortcut escapeFromCodeEditor from CodeEditor to MarkdownEditor, because it's not customizable --- browser/components/MarkdownEditor.js | 4 ++-- browser/main/lib/ConfigManager.js | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index 2ebb11b2..55e145d7 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -8,7 +8,7 @@ class MarkdownEditor extends React.Component { constructor (props) { super(props) - this.hotkey = props.config.hotkey + this.escapeFromEditor = ['Control', 'w'] this.state = { status: 'PREVIEW', @@ -152,7 +152,7 @@ class MarkdownEditor extends React.Component { }) this.setState({ keyPressed }) 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() } } diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index c6a587a1..e398ecc9 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -17,9 +17,6 @@ export const DEFAULT_CONFIG = { hotkey: { toggleFinder: OSX ? 'Cmd + Alt + S' : 'Super + Alt + S', toggleMain: OSX ? 'Cmd + Alt + L' : 'Super + Alt + E', - noteHandlerKey: { - escapeFromEditor: ['Control', 'w'] - } }, ui: { theme: 'default',