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
d0fd0961
Commit
d0fd0961
authored
Nov 11, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup context menu for externals
parent
974efc51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
file-explorer.js
src/app/files/file-explorer.js
+17
-18
No files found.
src/app/files/file-explorer.js
View file @
d0fd0961
...
@@ -208,6 +208,8 @@ function fileExplorer (localRegistry, files, menuItems) {
...
@@ -208,6 +208,8 @@ function fileExplorer (localRegistry, files, menuItems) {
MENU_HANDLE
&&
MENU_HANDLE
.
hide
(
null
,
true
)
MENU_HANDLE
&&
MENU_HANDLE
.
hide
(
null
,
true
)
let
actions
=
{}
let
actions
=
{}
const
provider
=
self
.
_deps
.
fileManager
.
fileProviderOf
(
key
)
const
provider
=
self
.
_deps
.
fileManager
.
fileProviderOf
(
key
)
actions
[
'Create File'
]
=
()
=>
self
.
createNewFile
(
key
)
actions
[
'Create Folder'
]
=
()
=>
self
.
createNewFolder
(
key
)
if
(
provider
.
isExternalFolder
(
key
))
{
if
(
provider
.
isExternalFolder
(
key
))
{
actions
[
'Discard changes'
]
=
()
=>
{
actions
[
'Discard changes'
]
=
()
=>
{
modalDialogCustom
.
confirm
(
modalDialogCustom
.
confirm
(
...
@@ -219,6 +221,21 @@ function fileExplorer (localRegistry, files, menuItems) {
...
@@ -219,6 +221,21 @@ function fileExplorer (localRegistry, files, menuItems) {
}
}
}
else
{
}
else
{
const
folderPath
=
extractExternalFolder
(
key
)
const
folderPath
=
extractExternalFolder
(
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
[
'Delete'
]
=
()
=>
{
if
(
self
.
files
.
isReadOnly
(
key
))
{
return
tooltip
(
'cannot delete folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
modalDialogCustom
.
confirm
(
'Confirm to delete a folder'
,
'Are you sure you want to delete this folder?'
,
()
=>
{
if
(
!
files
.
remove
(
key
))
tooltip
(
`failed to remove
${
key
}
. Make sure the directory is empty before removing it.`
)
else
{
self
.
updatePath
(
'browser'
)
}
},
()
=>
{})
}
if
(
folderPath
===
'browser/gists'
)
{
if
(
folderPath
===
'browser/gists'
)
{
actions
[
'Push changes to gist'
]
=
()
=>
{
actions
[
'Push changes to gist'
]
=
()
=>
{
const
id
=
key
.
substr
(
key
.
lastIndexOf
(
'/'
)
+
1
,
key
.
length
-
1
)
const
id
=
key
.
substr
(
key
.
lastIndexOf
(
'/'
)
+
1
,
key
.
length
-
1
)
...
@@ -230,24 +247,6 @@ function fileExplorer (localRegistry, files, menuItems) {
...
@@ -230,24 +247,6 @@ function fileExplorer (localRegistry, files, menuItems) {
)
)
}
}
}
}
actions
[
'Create File'
]
=
()
=>
self
.
createNewFile
(
key
)
actions
[
'Create Folder'
]
=
()
=>
self
.
createNewFolder
(
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
[
'Delete'
]
=
()
=>
{
if
(
self
.
files
.
isReadOnly
(
key
))
{
return
tooltip
(
'cannot delete folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
modalDialogCustom
.
confirm
(
'Confirm to delete a folder'
,
'Are you sure you want to delete this folder?'
,
()
=>
{
if
(
!
files
.
remove
(
key
))
tooltip
(
`failed to remove
${
key
}
. Make sure the directory is empty before removing it.`
)
else
{
self
.
updatePath
(
'browser'
)
}
},
()
=>
{})
}
}
MENU_HANDLE
=
contextMenu
(
event
,
actions
)
MENU_HANDLE
=
contextMenu
(
event
,
actions
)
})
})
...
...
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