-removed "rename" from folder's right click.

-added padding to context-menu
pull/5370/head
LianaHus 5 years ago
parent 36608b5622
commit 4030125933
  1. 12
      src/app/files/file-explorer.js
  2. 2
      src/app/ui/contextMenu.js

@ -206,10 +206,14 @@ function fileExplorer (localRegistry, files, menuItems) {
) )
} }
} else { } else {
actions['Rename'] = () => { // extracts first two folders
if (self.files.isReadOnly(key)) { return tooltip('cannot rename folder. ' + self.files.type + ' is a read only explorer') } const firstTwoFolders = key.substring(0, key.indexOf('/', key.indexOf('/', 1) + 1))
var name = label.querySelector('span[data-path="' + key + '"]') if (!provider.isExternalFolder(firstTwoFolders)) {
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'] = () => { actions['Delete'] = () => {

@ -45,7 +45,7 @@ module.exports = (event, items) => {
current.onclick = () => { hide(null, true); items[item]() } current.onclick = () => { hide(null, true); items[item]() }
return current 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.left = event.pageX + 'px'
container.style.top = event.pageY + 'px' container.style.top = event.pageY + 'px'
container.style.display = 'block' container.style.display = 'block'

Loading…
Cancel
Save