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
68ce33f2
Commit
68ce33f2
authored
Feb 12, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ability to rename/delete folder
parent
825fd8f7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
file-explorer.js
src/app/files/file-explorer.js
+16
-2
No files found.
src/app/files/file-explorer.js
View file @
68ce33f2
...
...
@@ -118,15 +118,29 @@ function fileExplorer (appAPI, files) {
}
})
self
.
treeView
.
event
.
register
(
'nodeRightClick'
,
function
(
key
,
data
,
label
,
event
)
{
contextMenu
(
event
,
{
'Rename'
:
()
=>
{
if
(
self
.
files
.
readonly
)
{
return
addTooltip
(
'cannot rename folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
var
name
=
label
.
querySelector
(
'label[data-path="'
+
key
+
'"]'
)
if
(
name
)
editModeOn
(
name
)
},
'Delete'
:
()
=>
{
if
(
self
.
files
.
readonly
)
{
return
addTooltip
(
'cannot delete folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
modalDialogCustom
.
confirm
(
null
,
'Do you want to delete this folder?'
,
()
=>
{
files
.
remove
(
key
)
},
()
=>
{})
}
})
})
self
.
treeView
.
event
.
register
(
'leafRightClick'
,
function
(
key
,
data
,
label
,
event
)
{
contextMenu
(
event
,
{
'Rename'
:
()
=>
{
if
(
self
.
files
.
readonly
)
{
return
addTooltip
(
'cannot rename. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
if
(
self
.
files
.
readonly
)
{
return
addTooltip
(
'cannot rename
file
. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
var
name
=
label
.
querySelector
(
'label[data-path="'
+
key
+
'"]'
)
if
(
name
)
editModeOn
(
name
)
},
'Delete'
:
()
=>
{
if
(
self
.
files
.
readonly
)
{
return
addTooltip
(
'cannot delete. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
if
(
self
.
files
.
readonly
)
{
return
addTooltip
(
'cannot delete
file
. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
modalDialogCustom
.
confirm
(
null
,
'Do you want to delete this file?'
,
()
=>
{
files
.
remove
(
key
)
},
()
=>
{})
}
})
...
...
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