use alt-t for switching tab

pull/1/head
yann300 6 years ago
parent f8f6dbfe0d
commit e59e9ed25a
  1. 18
      src/app/editor/editor.js
  2. 7
      src/app/panels/editor-panel.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)

@ -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) {

Loading…
Cancel
Save