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
121ca338
Commit
121ca338
authored
May 08, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't display the context menu for folder if !read only && display Copy to browser ifreadonly
parent
12508b67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
file-explorer.js
src/app/files/file-explorer.js
+16
-5
contextMenu.js
src/app/ui/contextMenu.js
+0
-1
No files found.
src/app/files/file-explorer.js
View file @
121ca338
...
...
@@ -172,6 +172,7 @@ function fileExplorer (localRegistry, files, menuItems) {
})
self
.
treeView
.
event
.
register
(
'nodeRightClick'
,
function
(
key
,
data
,
label
,
event
)
{
if
(
self
.
files
.
readonly
)
return
if
(
key
===
self
.
files
.
type
)
return
MENU_HANDLE
&&
MENU_HANDLE
.
hide
(
null
,
true
)
MENU_HANDLE
=
contextMenu
(
event
,
{
...
...
@@ -190,17 +191,27 @@ function fileExplorer (localRegistry, files, menuItems) {
self
.
treeView
.
event
.
register
(
'leafRightClick'
,
function
(
key
,
data
,
label
,
event
)
{
if
(
key
===
self
.
files
.
type
)
return
MENU_HANDLE
&&
MENU_HANDLE
.
hide
(
null
,
true
)
MENU_HANDLE
=
contextMenu
(
event
,
{
'Rename'
:
()
=>
{
let
actions
=
{}
if
(
!
self
.
files
.
readonly
)
{
actions
[
'Rename'
]
=
()
=>
{
if
(
self
.
files
.
readonly
)
{
return
tooltip
(
'cannot rename file. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
var
name
=
label
.
querySelector
(
'label[data-path="'
+
key
+
'"]'
)
if
(
name
)
editModeOn
(
name
)
}
,
'Delete'
:
()
=>
{
}
actions
[
'Delete'
]
=
()
=>
{
if
(
self
.
files
.
readonly
)
{
return
tooltip
(
'cannot delete file. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
modalDialogCustom
.
confirm
(
'Delete a file'
,
'Are you sure you want to delete this file?'
,
()
=>
{
files
.
remove
(
key
)
},
()
=>
{})
}
})
}
if
(
self
.
files
.
type
!==
'browser'
)
{
actions
[
'Copy to Browser explorer'
]
=
()
=>
{
files
.
get
(
key
,
(
error
,
content
)
=>
{
if
(
error
)
return
tooltip
(
error
)
self
.
_deps
.
fileManager
.
setFile
(
`browser/
${
label
.
innerText
}
`
,
content
)
})
}
}
MENU_HANDLE
=
contextMenu
(
event
,
actions
)
})
self
.
treeView
.
event
.
register
(
'leafClick'
,
function
(
key
,
data
,
label
)
{
...
...
src/app/ui/contextMenu.js
View file @
121ca338
...
...
@@ -7,7 +7,6 @@ var css = csjs`
{
display: none;
position: fixed;
width:100px;
border-radius: 2px;
z-index: 1000;
box-shadow: 0 0 4px var(--dark);
...
...
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