unselect current file when switch to an app tab

pull/3094/head
yann300 6 years ago
parent 5d8268734e
commit 99ec031160
  1. 6
      src/app/files/fileManager.js
  2. 2
      src/app/panels/editor-panel.js

@ -189,6 +189,12 @@ class FileManager extends FileSystemApi {
this.switchFile()
}
unselectCurrentFile () {
this.saveCurrentFile()
this._deps.config.set('currentFile', '')
this.events.emit('noFileSelected')
}
switchFile (file) {
const _switchFile = (file) => {
this.saveCurrentFile()

@ -51,11 +51,11 @@ class EditorPanel {
}
self.tabProxy = new TabProxy(self._deps.fileManager, self._components.editor, self.appStore, self.appManager)
let showApp = function (name) {
self._deps.fileManager.unselectCurrentFile()
self.mainPanelComponent.showContent(name)
self._view.editor.style.display = 'none'
self._components.contextView.hide()
self._view.mainPanel.style.display = 'block'
self.tabProxy.sh
}
self.appManager.event.on('ensureActivated', (name) => {
if (name === 'home') {

Loading…
Cancel
Save