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
9bfd3e65
Commit
9bfd3e65
authored
Jun 27, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix folder removal
parent
5fee645c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
file-explorer.js
src/app/file-explorer.js
+3
-2
No files found.
src/app/file-explorer.js
View file @
9bfd3e65
...
@@ -183,7 +183,7 @@ function fileExplorer (appAPI, files) {
...
@@ -183,7 +183,7 @@ function fileExplorer (appAPI, files) {
if
(
isFolder
)
path
+=
'/'
if
(
isFolder
)
path
+=
'/'
if
(
confirm
(
`Do you really want to delete "
${
path
}
" ?`
))
{
if
(
confirm
(
`Do you really want to delete "
${
path
}
" ?`
))
{
li
.
parentElement
.
removeChild
(
li
)
li
.
parentElement
.
removeChild
(
li
)
removeSubtree
(
files
,
path
)
removeSubtree
(
files
,
path
,
isFolder
)
}
}
}
}
...
@@ -343,7 +343,7 @@ function getLabelFrom (li) {
...
@@ -343,7 +343,7 @@ function getLabelFrom (li) {
return
li
.
children
[
0
].
children
[
1
].
children
[
0
]
return
li
.
children
[
0
].
children
[
1
].
children
[
0
]
}
}
function
removeSubtree
(
files
,
path
)
{
function
removeSubtree
(
files
,
path
,
isFolder
)
{
var
parts
=
path
.
split
(
'/'
)
var
parts
=
path
.
split
(
'/'
)
var
isFile
=
parts
[
parts
.
length
-
1
].
length
var
isFile
=
parts
[
parts
.
length
-
1
].
length
var
removePaths
=
isFile
?
[
path
]
:
Object
.
keys
(
files
.
list
()).
filter
(
keep
)
var
removePaths
=
isFile
?
[
path
]
:
Object
.
keys
(
files
.
list
()).
filter
(
keep
)
...
@@ -357,6 +357,7 @@ function removeSubtree (files, path) {
...
@@ -357,6 +357,7 @@ function removeSubtree (files, path) {
})
})
files
.
remove
(
path
)
files
.
remove
(
path
)
})
})
if
(
isFolder
)
files
.
remove
(
path
)
}
}
function
expandPathTo
(
li
)
{
function
expandPathTo
(
li
)
{
...
...
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