pull/5370/head
LianaHus 5 years ago
parent d7c90ba8a3
commit 36608b5622
  1. 8
      src/app/files/file-explorer.js
  2. 2
      src/app/files/fileProvider.js
  3. 4
      src/app/files/remixDProvider.js

@ -207,13 +207,13 @@ function fileExplorer (localRegistry, files, menuItems) {
}
} else {
actions['Rename'] = () => {
if (self.files.readonly) { 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 + '"]')
if (name) editModeOn(name)
}
}
actions['Delete'] = () => {
if (self.files.readonly) { 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) }, () => {})
}
MENU_HANDLE = contextMenu(event, actions)
@ -226,12 +226,12 @@ function fileExplorer (localRegistry, files, menuItems) {
const provider = self._deps.fileManager.fileProviderOf(key)
if (!provider.isExternalFolder(key)) {
actions['Rename'] = () => {
if (self.files.readonly) { return tooltip('cannot rename file. ' + self.files.type + ' is a read only explorer') }
if (self.files.isReadOnly(key)) { return tooltip('cannot rename file. ' + self.files.type + ' is a read only explorer') }
var name = label.querySelector('span[data-path="' + key + '"]')
if (name) editModeOn(name)
}
actions['Delete'] = () => {
if (self.files.readonly) { return tooltip('cannot delete file. ' + self.files.type + ' is a read only explorer') }
if (self.files.isReadOnly(key)) { return tooltip('cannot delete file. ' + self.files.type + ' is a read only explorer') }
modalDialogCustom.confirm(
'Delete a file', 'Are you sure you want to delete this file?',
() => { files.remove(key) },

@ -71,7 +71,7 @@ class FileProvider {
get (path, cb) {
cb = cb || function () {}
if (this.normalizedNameExists[path]) path = this.getNormalizedName(path) // ensure we actually use the normalized path from here
if (this.normalizedNameExists(path)) path = this.getNormalizedName(path) // ensure we actually use the normalized path from here
var unprefixedpath = this.removePrefix(path)
var exists = window.remixFileSystem.existsSync(unprefixedpath)
if (!exists) return cb(null, null)

@ -113,10 +113,6 @@ module.exports = class RemixDProvider {
return true
}
addReadOnly (path, content) {
return false
}
isReadOnly (path) {
return this._readOnlyMode || this._readOnlyFiles[path] === 1
}

Loading…
Cancel
Save