fix file-explorer "nodeClick"

pull/1/head
yann300 7 years ago
parent 2f56b8f3e6
commit 2b4e201977
  1. 10
      src/app/files/file-explorer.js

@ -131,15 +131,13 @@ function fileExplorer (appAPI, files) {
self.treeView.event.register('nodeClick', function (path, childrenContainer) {
if (!childrenContainer) return
if (childrenContainer.style.display === 'none') {
childrenContainer.innerHTML = ''
return
}
if (childrenContainer.style.display === 'none') return
files.resolveDirectory(path, (error, fileTree) => {
if (error) console.error(error)
if (!fileTree) return
var newTree = normalize(path, fileTree)
self.treeView.updateNodeFromJSON(path, newTree, false)
self.treeView.updateNodeFromJSON(path, newTree, true)
})
})
@ -275,7 +273,7 @@ function fileExplorer (appAPI, files) {
if (error) console.error(error)
if (!fileTree) return
fileTree = normalize(folderpath, fileTree)
self.treeView.updateNodeFromJSON(folderpath, fileTree, false)
self.treeView.updateNodeFromJSON(folderpath, fileTree, true)
self.focusElement = self.treeView.labelAt(self.focusPath)
// TODO: here we update the selected file (it applicable)
// cause we are refreshing the interface of the whole directory when there's a new file.

Loading…
Cancel
Save