added isExternalFolder to remixdProvider

pull/1/head
LianaHus 5 years ago
parent bef86abaf0
commit 33d15900eb
  1. 13
      src/app/files/file-explorer.js
  2. 4
      src/app/files/remixDProvider.js

@ -191,7 +191,7 @@ function fileExplorer (localRegistry, files, menuItems) {
})
/**
* Extracts furst two folders as a subpath from the path.
* Extracts first two folders as a subpath from the path.
**/
function extractExternalFolder (path) {
const firstSlIndex = path.indexOf('/', 1)
@ -200,6 +200,7 @@ function fileExplorer (localRegistry, files, menuItems) {
if (secondSlIndex === -1) return ''
return path.substring(0, secondSlIndex)
}
self.treeView.event.register('nodeRightClick', function (key, data, label, event) {
if (self.files.readonly) return
if (key === self.files.type) return
@ -228,12 +229,10 @@ function fileExplorer (localRegistry, files, menuItems) {
)
}
}
if (!provider.isExternalFolder(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['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'] = () => {

@ -150,6 +150,10 @@ module.exports = class RemixDProvider {
return true
}
isExternalFolder (path) {
return false
}
removePrefix (path) {
path = path.indexOf(this.type) === 0 ? path.replace(this.type, '') : path
if (path[0] === '/') return path.substring(1)

Loading…
Cancel
Save