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
33d15900
Commit
33d15900
authored
Sep 30, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added isExternalFolder to remixdProvider
parent
bef86aba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
file-explorer.js
src/app/files/file-explorer.js
+6
-7
remixDProvider.js
src/app/files/remixDProvider.js
+4
-0
No files found.
src/app/files/file-explorer.js
View file @
33d15900
...
...
@@ -191,7 +191,7 @@ function fileExplorer (localRegistry, files, menuItems) {
})
/**
* Extracts f
u
rst two folders as a subpath from the path.
* Extracts f
i
rst two folders as a subpath from the path.
**/
function
extractExternalFolder
(
path
)
{
const
firstSlIndex
=
path
.
indexOf
(
'/'
,
1
)
...
...
@@ -200,6 +200,7 @@ function fileExplorer (localRegistry, files, menuItems) {
if
(
secondSlIndex
===
-
1
)
return
''
return
path
.
substring
(
0
,
secondSlIndex
)
}
self
.
treeView
.
event
.
register
(
'nodeRightClick'
,
function
(
key
,
data
,
label
,
event
)
{
if
(
self
.
files
.
readonly
)
return
if
(
key
===
self
.
files
.
type
)
return
...
...
@@ -228,12 +229,10 @@ function fileExplorer (localRegistry, files, menuItems) {
)
}
}
if
(
!
provider
.
isExternalFolder
(
key
))
{
actions
[
'Rename'
]
=
()
=>
{
if
(
self
.
files
.
isReadOnly
(
key
))
{
return
tooltip
(
'cannot rename folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
var
name
=
label
.
querySelector
(
'span[data-path="'
+
key
+
'"]'
)
if
(
name
)
editModeOn
(
name
)
}
actions
[
'Rename'
]
=
()
=>
{
if
(
self
.
files
.
isReadOnly
(
key
))
{
return
tooltip
(
'cannot rename folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
var
name
=
label
.
querySelector
(
'span[data-path="'
+
key
+
'"]'
)
if
(
name
)
editModeOn
(
name
)
}
}
actions
[
'Delete'
]
=
()
=>
{
...
...
src/app/files/remixDProvider.js
View file @
33d15900
...
...
@@ -150,6 +150,10 @@ module.exports = class RemixDProvider {
return
true
}
isExternalFolder
(
path
)
{
return
false
}
removePrefix
(
path
)
{
path
=
path
.
indexOf
(
this
.
type
)
===
0
?
path
.
replace
(
this
.
type
,
''
)
:
path
if
(
path
[
0
]
===
'/'
)
return
path
.
substring
(
1
)
...
...
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