diff --git a/src/app/tabs/compileTab/compilerContainer.js b/src/app/tabs/compileTab/compilerContainer.js
index ad0998d94f..6555fa1d4b 100644
--- a/src/app/tabs/compileTab/compilerContainer.js
+++ b/src/app/tabs/compileTab/compilerContainer.js
@@ -110,6 +110,11 @@ class CompilerContainer {
return el
}
+ _retriveVersion() {
+ let version = this._view.versionSelector.value
+ return version.substring(9,14)
+ }
+
render () {
this.compileTabLogic.compiler.event.register('compilerLoaded', (version) => this.setVersionText(version))
this.fetchAllVersion((allversions, selectedVersion) => {
@@ -132,6 +137,11 @@ class CompilerContainer {
`
+ this._view.languageSelector = yo`
+ `
this._view.version = yo``
this._view.evmVersionSelector = yo`
@@ -177,13 +187,10 @@ class CompilerContainer {
-
+
-
+ ${this._view.languageSelector}
@@ -217,6 +224,7 @@ class CompilerContainer {
`
+ this._updateLanguageSelector()
return this._view.compileContainer
}
@@ -240,7 +248,9 @@ class CompilerContainer {
onchangeLanguage (event) {
this.compileTabLogic.setLanguage(event.target.value)
- this.compile()
+ if (this.config.get('currentFile') && this.config.get('autoCompile')) {
+ this.compile()
+ }
}
onchangeEvmVersion (_) {
@@ -256,6 +266,7 @@ class CompilerContainer {
onchangeLoadVersion (event) {
this.data.selectedVersion = this._view.versionSelector.value
this._updateVersionSelector()
+ this._updateLanguageSelector()
}
_updateVersionSelector () {
@@ -294,6 +305,16 @@ class CompilerContainer {
}
}
+ _updateLanguageSelector () {
+ if (this._retriveVersion() < '0.5.7') {
+ this._view.languageSelector.setAttribute('disabled', '')
+ this._view.languageSelector.value = 'Solidity'
+ this.compileTabLogic.setLanguage('Solidity')
+ } else {
+ this._view.languageSelector.removeAttribute('disabled')
+ }
+ }
+
setVersionText (text) {
this.data.version = text
if (this._view.version) this._view.version.innerText = text