Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
d51d6b8d
Commit
d51d6b8d
authored
Jan 31, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix file added
parent
a0ef64ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
file-explorer.js
src/app/files/file-explorer.js
+14
-9
No files found.
src/app/files/file-explorer.js
100644 → 100755
View file @
d51d6b8d
...
@@ -317,15 +317,20 @@ function fileExplorer (appAPI, files) {
...
@@ -317,15 +317,20 @@ function fileExplorer (appAPI, files) {
}
}
function
fileAdded
(
filepath
)
{
function
fileAdded
(
filepath
)
{
var
folderpath
=
filepath
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
self
.
ensureRoot
(()
=>
{
self
.
files
.
resolveDirectory
(
folderpath
,
(
error
,
fileTree
)
=>
{
var
folderpath
=
filepath
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
if
(
error
)
console
.
error
(
error
)
if
(
!
fileTree
)
return
fileTree
=
normalize
(
folderpath
,
fileTree
)
var
newTree
=
self
.
treeView
.
renderProperties
(
fileTree
,
false
)
var
currentTree
=
self
.
treeView
.
nodeAt
(
folderpath
)
var
currentTree
=
self
.
treeView
.
nodeAt
(
folderpath
)
currentTree
.
innerHTML
=
''
if
(
currentTree
)
{
;[...
newTree
.
children
].
forEach
(
child
=>
currentTree
.
appendChild
(
child
))
self
.
files
.
resolveDirectory
(
folderpath
,
(
error
,
fileTree
)
=>
{
if
(
error
)
console
.
error
(
error
)
if
(
!
fileTree
)
return
fileTree
=
normalize
(
folderpath
,
fileTree
)
var
newTree
=
self
.
treeView
.
renderProperties
(
fileTree
,
false
)
currentTree
.
innerHTML
=
''
;[...
newTree
.
children
].
forEach
(
child
=>
currentTree
.
appendChild
(
child
))
})
}
})
})
}
}
}
}
...
@@ -398,7 +403,7 @@ fileExplorer.prototype.ensureRoot = function (cb) {
...
@@ -398,7 +403,7 @@ fileExplorer.prototype.ensureRoot = function (cb) {
element
.
events
=
self
.
events
element
.
events
=
self
.
events
element
.
api
=
self
.
api
element
.
api
=
self
.
api
self
.
container
.
appendChild
(
element
)
self
.
container
.
appendChild
(
element
)
self
.
element
=
element
self
.
element
=
element
if
(
cb
)
cb
()
if
(
cb
)
cb
()
})
})
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment