Commit 137966a4 authored by LianaHus's avatar LianaHus Committed by Liana Husikyan

disabled "discard changes" in context menu of FE

parent 88fcd49d
......@@ -209,7 +209,9 @@ function fileExplorer (localRegistry, files, menuItems) {
const provider = self._deps.fileManager.fileProviderOf(key)
actions['Create File'] = () => self.createNewFile(key)
actions['Create Folder'] = () => self.createNewFolder(key)
if (provider.isExternalFolder(key)) {
// todo not fully implemented. Readd later when fixed
// https://github.com/ethereum/remix-ide/issues/2386
/* if (provider.isExternalFolder(key)) {
actions['Discard changes'] = () => {
modalDialogCustom.confirm(
'Discard changes',
......@@ -218,7 +220,8 @@ function fileExplorer (localRegistry, files, menuItems) {
() => {}
)
}
} else {
} else { */
if (! provider.isExternalFolder(key)) {
const folderPath = extractExternalFolder(key)
actions['Rename'] = () => {
if (self.files.isReadOnly(key)) { return tooltip('cannot rename folder. ' + self.files.type + ' is a read only explorer') }
......
......@@ -59,7 +59,8 @@ class FileManager extends Plugin {
}
fileChangedEvent (path) {
this.syncEditor(path)
// todo. use only for discard changes function.
//this.syncEditor(path)
}
fileRenamedEvent (oldName, newName, isFolder) {
......
......@@ -136,7 +136,7 @@ class CompilerContainer {
if (pragmaArr && pragmaArr.length === 1) {
const pragmaStr = pragmaArr[0].replace('pragma solidity', '').trim()
const pragma = pragmaStr.substring(0, pragmaStr.length - 1)
const releasedVersions = this.data.allversions.filter(obj => !obj.prerelease).map(obj => obj.version)
const releasedVersions = (this.data.allversions) ? this.data.allversions.filter(obj => !obj.prerelease).map(obj => obj.version) : []
const allVersions = this.data.allversions.map(obj => this._retrieveVersion(obj.version))
const currentCompilerName = this._retrieveVersion(this._view.versionSelector.selectedOptions[0].label)
// contains only numbers part, for example '0.4.22'
......
......@@ -45,7 +45,7 @@ module.exports = (event, items) => {
current.onclick = () => { hide(null, true); items[item]() }
return current
})
var container = yo`<div class="p-1 ${css.container} bg-light"><ul id='menuitems'>${menu}</ul></div>`
var container = yo`<div class="p-1 ${css.container} bg-light shadow border"><ul id='menuitems'>${menu}</ul></div>`
container.style.left = event.pageX + 'px'
container.style.top = event.pageY + 'px'
container.style.display = 'block'
......
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