Commit 33d15900 authored by LianaHus's avatar LianaHus

added isExternalFolder to remixdProvider

parent bef86aba
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment