listen on activation

pull/1/head
yann300 6 years ago
parent bf95e60060
commit 96c8d64490
  1. 6
      src/app/tabs/compile-tab.js
  2. 9
      src/app/tabs/compileTab/compilerContainer.js

@ -54,8 +54,14 @@ class CompileTab {
this._deps.config, this._deps.config,
this.queryParams this.queryParams
) )
}
activate () {
this.listenToEvents() this.listenToEvents()
this.compilerContainer.activate()
}
deactivate () {
} }
/************ /************

@ -25,8 +25,6 @@ class CompilerContainer {
defaultVersion: 'soljson-v0.5.1+commit.c8a2cb62.js', // this default version is defined: in makeMockCompiler (for browser test) and in package.json (downloadsolc_root) for the builtin compiler defaultVersion: 'soljson-v0.5.1+commit.c8a2cb62.js', // this default version is defined: in makeMockCompiler (for browser test) and in package.json (downloadsolc_root) for the builtin compiler
baseurl: 'https://solc-bin.ethereum.org/bin' baseurl: 'https://solc-bin.ethereum.org/bin'
} }
this.listenToEvents()
} }
/** /**
@ -38,6 +36,13 @@ class CompilerContainer {
yo.update(this._view.compilationButton, button) yo.update(this._view.compilationButton, button)
} }
deactivate () {
}
activate () {
this.listenToEvents()
}
listenToEvents () { listenToEvents () {
this.editor.event.register('contentChanged', this.scheduleCompilation.bind(this)) this.editor.event.register('contentChanged', this.scheduleCompilation.bind(this))
this.editor.event.register('sessionSwitched', this.scheduleCompilation.bind(this)) this.editor.event.register('sessionSwitched', this.scheduleCompilation.bind(this))

Loading…
Cancel
Save