diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index 2e228e955d..2750ecdd40 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -130,24 +130,6 @@ class Editor { readOnly: true }) - this.editor.commands.addCommand({ - name: 'movenexttab', - bindKey: {win: 'Ctrl-Right', mac: 'Command-Right'}, - exec: (editor) => { - this.event.trigger('switchNextTab', []) - }, - readOnly: true - }) - - this.editor.commands.addCommand({ - name: 'moveprevioustab', - bindKey: {win: 'Ctrl-Left', mac: 'Command-Left'}, - exec: (editor) => { - this.event.trigger('switchPreviousTab', []) - }, - readOnly: true - }) - this.editor.setShowPrintMargin(false) this.editor.resize(true) diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index b5a474b94c..fd0a50f15d 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -56,8 +56,6 @@ class EditorPanel { self._components.contextView.hide() self._view.mainPanel.style.display = 'block' } - self._components.editor.event.register('switchNextTab', () => { self.tabProxy.switchNextTab() }) - self._components.editor.event.register('switchPreviousTab', () => { self.tabProxy.switchPreviousTab() }) self.appManager.event.on('ensureActivated', (name) => { if (name === 'home') { showApp(name) } }) /* We listen here on event from the tab component to display / hide the editor and mainpanel @@ -192,6 +190,11 @@ class EditorPanel { ` // INIT self._adjustLayout('top', self.data._layout.top.offset) + + document.addEventListener('keydown', (e) => { + if (e.altKey && e.keyCode === 84) self.tabProxy.switchNextTab() + }) + return self._view.el } registerCommand (name, command, opts) {