|
|
@ -10,6 +10,8 @@ var helper = require('../../lib/helper') |
|
|
|
|
|
|
|
|
|
|
|
var css = require('./styles/file-explorer-styles') |
|
|
|
var css = require('./styles/file-explorer-styles') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let MENU_HANDLE |
|
|
|
|
|
|
|
|
|
|
|
function fileExplorer (appAPI, files) { |
|
|
|
function fileExplorer (appAPI, files) { |
|
|
|
var self = this |
|
|
|
var self = this |
|
|
|
this.events = new EventManager() |
|
|
|
this.events = new EventManager() |
|
|
@ -119,7 +121,8 @@ function fileExplorer (appAPI, files) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
self.treeView.event.register('nodeRightClick', function (key, data, label, event) { |
|
|
|
self.treeView.event.register('nodeRightClick', function (key, data, label, event) { |
|
|
|
contextMenu(event, { |
|
|
|
MENU_HANDLE && MENU_HANDLE.hide(null, true) |
|
|
|
|
|
|
|
MENU_HANDLE = contextMenu(event, { |
|
|
|
'Rename': () => { |
|
|
|
'Rename': () => { |
|
|
|
if (self.files.readonly) { return addTooltip('cannot rename folder. ' + self.files.type + ' is a read only explorer') } |
|
|
|
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 + '"]') |
|
|
|
var name = label.querySelector('label[data-path="' + key + '"]') |
|
|
@ -133,7 +136,8 @@ function fileExplorer (appAPI, files) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
self.treeView.event.register('leafRightClick', function (key, data, label, event) { |
|
|
|
self.treeView.event.register('leafRightClick', function (key, data, label, event) { |
|
|
|
contextMenu(event, { |
|
|
|
MENU_HANDLE && MENU_HANDLE.hide(null, true) |
|
|
|
|
|
|
|
MENU_HANDLE = contextMenu(event, { |
|
|
|
'Rename': () => { |
|
|
|
'Rename': () => { |
|
|
|
if (self.files.readonly) { return addTooltip('cannot rename file. ' + 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 + '"]') |
|
|
|
var name = label.querySelector('label[data-path="' + key + '"]') |
|
|
|