currentPath and add to API

pull/1/head
yann300 7 years ago
parent 9429b8c61e
commit 6e6bfcc373
  1. 3
      src/app.js
  2. 7
      src/app/files/fileManager.js

@ -569,6 +569,9 @@ function run () {
fileProvider: (name) => {
return self._api.filesProviders[name]
},
currentPath: function () {
return fileManager.currentPath()
},
getBalance: (address, callback) => {
udapp.getBalance(address, (error, balance) => {
if (error) {

@ -79,6 +79,13 @@ class FileManager {
this.refreshTabs()
}
currentPath () {
var currentFile = this.opt.config.get('currentFile')
var reg = /(.*\/).*/
var path = reg.exec(currentFile)
return path ? path[1] : null
}
fileRemovedEvent (path) {
if (path === this.opt.config.get('currentFile')) {
this.opt.config.set('currentFile', '')

Loading…
Cancel
Save