From e78e4c6b10f1283a848c09f786b18a61336869ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20H=C3=A4usler?= Date: Wed, 6 Nov 2019 18:53:22 +0100 Subject: [PATCH] Fix outdated export command (#1627) * Fix outdated export command * Fix more commands by focusing editor --- src/renderer/commands/index.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/renderer/commands/index.js b/src/renderer/commands/index.js index 0966dc55..c93b457c 100644 --- a/src/renderer/commands/index.js +++ b/src/renderer/commands/index.js @@ -76,7 +76,7 @@ const commands = [ description: 'File: Print current Tab', execute: async () => { await delay(50) - ipcRenderer.emit('mt::show-export-dialog', null, 'print') + bus.$emit('showExportDialog', 'print') } }, { id: 'file.close-tab', @@ -125,14 +125,14 @@ const commands = [ description: 'HTML', execute: async () => { await delay(50) - bus.$emit('export', 'styledHtml') + bus.$emit('showExportDialog', 'styledHtml') } }, { id: 'file.export-file-pdf', description: 'PDF', execute: async () => { await delay(50) - bus.$emit('export', 'pdf') + bus.$emit('showExportDialog', 'pdf') } }] }, @@ -144,13 +144,17 @@ const commands = [ id: 'edit.undo', description: 'Edit: Undo', execute: async () => { - bus.$emit('undo', 'undo') + focusEditorAndExecute( + () => bus.$emit('undo', 'undo') + ) } }, { id: 'edit.redo', description: 'Edit: Redo', execute: async () => { - bus.$emit('redo', 'redo') + focusEditorAndExecute( + () => bus.$emit('redo', 'redo') + ) } }, { id: 'edit.duplicate', @@ -616,13 +620,17 @@ const commands = [ id: 'view.typewriter-mode', description: 'View: Toggle Typewriter Mode', execute: async () => { - bus.$emit('view:toggle-view-entry', 'typewriter') + focusEditorAndExecute( + () => bus.$emit('view:toggle-view-entry', 'typewriter') + ) } }, { id: 'view.focus-mode', description: 'View: Focus Mode', execute: async () => { - bus.$emit('view:toggle-view-entry', 'focus') + focusEditorAndExecute( + () => bus.$emit('view:toggle-view-entry', 'focus') + ) } }, { id: 'view.toggle-sidebar',