Skip to content

Commit

Permalink
disabled "discard changes" in context menu of FE
Browse files Browse the repository at this point in the history
  • Loading branch information
LianaHus committed Dec 9, 2019
1 parent 88fcd49 commit dc540c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/app/files/file-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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') }
Expand Down
3 changes: 2 additions & 1 deletion src/app/files/fileManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/tabs/compileTab/compilerContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/app/ui/contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit dc540c1

Please sign in to comment.