Skip to content

Commit

Permalink
-removed "rename" from folder's right click.
Browse files Browse the repository at this point in the history
-added padding to context-menu
  • Loading branch information
LianaHus committed Sep 26, 2019
1 parent 8143b8e commit 9a74c70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/app/files/file-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,14 @@ function fileExplorer (localRegistry, files, menuItems) {
)
}
} else {
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)
// extracts first two folders
const firstTwoFolders = key.substring(0, key.indexOf('/', key.indexOf('/', 1) + 1))
if (!provider.isExternalFolder(firstTwoFolders)) {
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'] = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = (event, items) => {
current.onclick = () => { hide(null, true); items[item]() }
return current
})
var container = yo`<div class="${css.container} bg-light"><ul id='menuitems'>${menu}</ul></div>`
var container = yo`<div class="p-1 ${css.container} bg-light"><ul id='menuitems'>${menu}</ul></div>`
container.style.left = event.pageX + 'px'
container.style.top = event.pageY + 'px'
container.style.display = 'block'
Expand Down

0 comments on commit 9a74c70

Please sign in to comment.