diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js
index b303c669f1..413c9aaa91 100644
--- a/src/app/tabs/compile-tab.js
+++ b/src/app/tabs/compile-tab.js
@@ -18,10 +18,12 @@ module.exports = class CompileTab {
self._api = api
self._events = events
self._view = {
- el: null
+ el: null,
+ autoCompile: null,
+ compileButton: null
}
self.data = {
- autoCompile: self._opts.config.get('autoCompile') || false,
+ autoCompile: self._opts.config.get('autoCompile'),
compileTimeout: null,
contractsDetails: {},
maxTime: 1000,
@@ -120,32 +122,34 @@ module.exports = class CompileTab {
// Containers
var warnCompilationSlow = yo``
var compileIcon = yo``
+ self._view.compileButton = yo`
${compileIcon} Start to compile
`
+ self._view.autoCompile = yo``
+ if (self.data.autoCompile) self._view.autoCompile.setAttribute('checked', '')
var compileContainer = yo`
`
- compileContainer.querySelector('#compile').addEventListener('click', () => {
- self._api.runCompiler()
- })
- var autoCompileInput = compileContainer.querySelector('#autoCompile')
- var autoCompile = false
- if (opts.config.exists('autoCompile')) {
- autoCompile = opts.config.get('autoCompile')
- }
- opts.config.set('autoCompile', autoCompile)
- if (autoCompile) {
- autoCompileInput.setAttribute('checked', autoCompile)
- }
- autoCompileInput.addEventListener('change', function () {
- opts.config.set('autoCompile', autoCompileInput.checked)
- })
+ function updateAutoCompile (event) { self._opts.config.set('autoCompile', self._view.autoCompile.checked) }
+ function compile (event) { self._api.runCompiler() }
+ // compileContainer.querySelector('#compile').addEventListener('click', () => {
+ // self._api.runCompiler()
+ // })
+ // var autoCompileInput = compileContainer.querySelector('#autoCompile')
+ // var autoCompile = false
+ // if (opts.config.exists('autoCompile')) {
+ // autoCompile = opts.config.get('autoCompile')
+ // }
+ // opts.config.set('autoCompile', autoCompile)
+ // self._view.autoCompile.addEventListener('change', function () {
+ //
+ // })
var errorContainer = yo``
var contractsDetails = {}
var contractEl = yo`