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

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

@ -206,12 +206,16 @@ function fileExplorer (localRegistry, files, menuItems) {
) )
} }
} else { } else {
// extracts first two folders
const firstTwoFolders = key.substring(0, key.indexOf('/', key.indexOf('/', 1) + 1))
if (!provider.isExternalFolder(firstTwoFolders)) {
actions['Rename'] = () => { actions['Rename'] = () => {
if (self.files.isReadOnly(key)) { return tooltip('cannot rename folder. ' + self.files.type + ' is a read only explorer') } 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 + '"]') var name = label.querySelector('span[data-path="' + key + '"]')
if (name) editModeOn(name) if (name) editModeOn(name)
} }
} }
}
actions['Delete'] = () => { actions['Delete'] = () => {
if (self.files.isReadOnly(key)) { return tooltip('cannot delete folder. ' + self.files.type + ' is a read only explorer') } 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?', () => { files.remove(key) }, () => {}) modalDialogCustom.confirm('Confirm to delete a folder', 'Are you sure you want to delete this folder?', () => { files.remove(key) }, () => {})

@ -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