ability to rename/delete folder

pull/1/head
yann300 7 years ago
parent 825fd8f72f
commit 68ce33f28c
  1. 18
      src/app/files/file-explorer.js

@ -118,15 +118,29 @@ function fileExplorer (appAPI, files) {
}
})
self.treeView.event.register('nodeRightClick', function (key, data, label, event) {
contextMenu(event, {
'Rename': () => {
if (self.files.readonly) { return addTooltip('cannot rename folder. ' + self.files.type + ' is a read only explorer') }
var name = label.querySelector('label[data-path="' + key + '"]')
if (name) editModeOn(name)
},
'Delete': () => {
if (self.files.readonly) { return addTooltip('cannot delete folder. ' + self.files.type + ' is a read only explorer') }
modalDialogCustom.confirm(null, 'Do you want to delete this folder?', () => { files.remove(key) }, () => {})
}
})
})
self.treeView.event.register('leafRightClick', function (key, data, label, event) {
contextMenu(event, {
'Rename': () => {
if (self.files.readonly) { return addTooltip('cannot rename. ' + self.files.type + ' is a read only explorer') }
if (self.files.readonly) { return addTooltip('cannot rename file. ' + self.files.type + ' is a read only explorer') }
var name = label.querySelector('label[data-path="' + key + '"]')
if (name) editModeOn(name)
},
'Delete': () => {
if (self.files.readonly) { return addTooltip('cannot delete. ' + self.files.type + ' is a read only explorer') }
if (self.files.readonly) { return addTooltip('cannot delete file. ' + self.files.type + ' is a read only explorer') }
modalDialogCustom.confirm(null, 'Do you want to delete this file?', () => { files.remove(key) }, () => {})
}
})

Loading…
Cancel
Save