fix localhost explorer ui interface

pull/1/head
yann300 7 years ago
parent 825fd8f72f
commit d054f31763
  1. 11
      src/app/files/file-explorer.js
  2. 10
      src/app/panels/file-panel.js

@ -228,14 +228,23 @@ function fileExplorer (appAPI, files) {
}
}
fileExplorer.prototype.hide = function () {
if (this.container) this.container.style.display = 'none'
}
fileExplorer.prototype.show = function () {
if (this.container) this.container.style.display = 'block'
}
fileExplorer.prototype.init = function () {
this.container = yo`<div></div>`
return this.container
}
fileExplorer.prototype.ensureRoot = function (cb) {
cb = cb || (() => {})
var self = this
if (self.element && cb) return cb()
if (self.element) return cb()
self.files.resolveDirectory('/', (error, files) => {
if (error) console.error(error)

@ -89,7 +89,6 @@ function filepanel (appAPI, filesProvider) {
self.event = event
var element = template()
fileExplorer.ensureRoot()
var containerFileSystem = element.querySelector('.filesystemexplorer')
var websocketconn = element.querySelector('.websocketconn')
filesProvider['localhost'].remixd.event.register('connecting', (event) => {
websocketconn.style.color = styles.colors.yellow
@ -99,22 +98,19 @@ function filepanel (appAPI, filesProvider) {
filesProvider['localhost'].remixd.event.register('connected', (event) => {
websocketconn.style.color = styles.colors.green
websocketconn.setAttribute('title', 'Connected to localhost. ' + JSON.stringify(event))
fileSystemExplorer.show()
})
filesProvider['localhost'].remixd.event.register('errored', (event) => {
websocketconn.style.color = styles.colors.red
websocketconn.setAttribute('title', 'localhost connection errored. ' + JSON.stringify(event))
if (fileSystemExplorer.element && containerFileSystem.children.length > 0) {
containerFileSystem.removeChild(fileSystemExplorer.element)
}
fileSystemExplorer.hide()
})
filesProvider['localhost'].remixd.event.register('closed', (event) => {
websocketconn.style.color = styles.colors.black
websocketconn.setAttribute('title', 'localhost connection closed. ' + JSON.stringify(event))
if (fileSystemExplorer.element && containerFileSystem.children.length > 0) {
containerFileSystem.removeChild(fileSystemExplorer.element)
}
fileSystemExplorer.hide()
})
fileExplorer.events.register('focus', function (path) {

Loading…
Cancel
Save