Skip to content

Commit

Permalink
fix Default to editor if no tabs opened
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 authored and LianaHus committed Jul 16, 2019
1 parent f57a3c4 commit e43adab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/app/files/fileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ class FileManager extends Plugin {
if (fileList.length) {
_switchFile(browserProvider.type + '/' + fileList[0])
} else {
this.editor.displayEmptyReadOnlySession()
this.events.emit('noFileSelected')
}
})
Expand Down
3 changes: 3 additions & 0 deletions src/app/panels/main-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 2 additions & 0 deletions src/app/panels/tab-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e43adab

Please sign in to comment.