fix Default to editor if no tabs opened

pull/1/head
yann300 6 years ago committed by LianaHus
parent f57a3c41e7
commit e43adaba59
  1. 1
      src/app/files/fileManager.js
  2. 3
      src/app/panels/main-view.js
  3. 2
      src/app/panels/tab-proxy.js

@ -272,7 +272,6 @@ class FileManager extends Plugin {
if (fileList.length) {
_switchFile(browserProvider.type + '/' + fileList[0])
} else {
this.editor.displayEmptyReadOnlySession()
this.events.emit('noFileSelected')
}
})

@ -82,6 +82,9 @@ export class MainView {
self._components.contextView.show()
self._view.mainPanel.style.display = 'none'
})
self.tabProxy.event.on('tabCountChanged', (count) => {
if (!count) this.editor.displayEmptyReadOnlySession()
})
self.data = {
_layout: {
top: {

@ -151,9 +151,11 @@ export class TabProxy {
this._view.filetabs = yo`<remix-tabs></remix-tabs>`
this._view.filetabs.addEventListener('tabClosed', (event) => {
if (this._handlers[event.detail]) this._handlers[event.detail].close()
this.event.emit('tabCountChanged', this._view.filetabs.tabs.length)
})
this._view.filetabs.addEventListener('tabActivated', (event) => {
if (this._handlers[event.detail]) this._handlers[event.detail].switchTo()
this.event.emit('tabCountChanged', this._view.filetabs.tabs.length)
})
this._view.filetabs.canAdd = false

Loading…
Cancel
Save