From 3e4dc371639689a695e54390949328f2d0dbc596 Mon Sep 17 00:00:00 2001 From: LianaHus Date: Thu, 26 Sep 2019 17:37:11 +0200 Subject: [PATCH] -removed "rename" from folder's right click. -added padding to context-menu --- src/app/files/file-explorer.js | 12 ++++++++---- src/app/ui/contextMenu.js | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index ec9f86b614..44be2a4e66 100644 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -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'] = () => { diff --git a/src/app/ui/contextMenu.js b/src/app/ui/contextMenu.js index 8052adf5f7..a4371f6a40 100644 --- a/src/app/ui/contextMenu.js +++ b/src/app/ui/contextMenu.js @@ -45,7 +45,7 @@ module.exports = (event, items) => { current.onclick = () => { hide(null, true); items[item]() } return current }) - var container = yo`
` + var container = yo`
` container.style.left = event.pageX + 'px' container.style.top = event.pageY + 'px' container.style.display = 'block'