add tooltip

pull/1/head
yann300 7 years ago
parent c6e642afe0
commit e0546174f7
  1. 4
      src/app/files/file-explorer.js

@ -6,6 +6,7 @@ var modalDialogCustom = require('../ui/modal-dialog-custom')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var EventManager = remixLib.EventManager var EventManager = remixLib.EventManager
var contextMenu = require('../ui/contextMenu') var contextMenu = require('../ui/contextMenu')
var addTooltip = require('../ui/tooltip')
var helper = require('../../lib/helper') var helper = require('../../lib/helper')
var styleGuide = remixLib.ui.themeChooser var styleGuide = remixLib.ui.themeChooser
@ -163,11 +164,12 @@ 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, { contextMenu(event, {
'Rename': () => { 'Rename': () => {
if (self.files.readonly) return if (self.files.readonly) { return addTooltip('cannot rename. ' + self.files.type + ' is a read only explorer') }
var name = label.querySelector('label[data-path="' + key + '"]') var name = label.querySelector('label[data-path="' + key + '"]')
if (name) editModeOn(name) if (name) editModeOn(name)
}, },
'Delete': () => { 'Delete': () => {
if (self.files.readonly) { return addTooltip('cannot delete. ' + self.files.type + ' is a read only explorer') }
modalDialogCustom.confirm(null, 'Do you want to delete this file?', () => { files.remove(key) }, () => {}) modalDialogCustom.confirm(null, 'Do you want to delete this file?', () => { files.remove(key) }, () => {})
} }
}) })

Loading…
Cancel
Save