Commit c291bec9 authored by serapath's avatar serapath

CompileTab: refactor merge event listener

parent 66144ce3
...@@ -55,15 +55,6 @@ class CompileTab { ...@@ -55,15 +55,6 @@ class CompileTab {
warnCompilationSlow.style.display = 'none' warnCompilationSlow.style.display = 'none'
compileIcon.setAttribute('title', 'compiler is loading, please wait a few moments.') compileIcon.setAttribute('title', 'compiler is loading, please wait a few moments.')
}) })
self._events.compiler.register('compilationFinished', function finish () {
if (!compileIcon) return
var compileTab = document.querySelector('.compileView')
compileTab.style.color = styles.colors.black
compileIcon.style.color = styles.colors.black
compileIcon.classList.remove(`${css.spinningIcon}`)
compileIcon.classList.remove(`${css.bouncingIcon}`)
compileIcon.setAttribute('title', 'idle')
})
self._events.compiler.register('compilationStarted', function start () { self._events.compiler.register('compilationStarted', function start () {
if (!compileIcon) return if (!compileIcon) return
errorContainer.innerHTML = '' errorContainer.innerHTML = ''
...@@ -76,7 +67,15 @@ class CompileTab { ...@@ -76,7 +67,15 @@ class CompileTab {
compileIcon.classList.remove(`${css.spinningIcon}`) compileIcon.classList.remove(`${css.spinningIcon}`)
compileIcon.setAttribute('title', '') compileIcon.setAttribute('title', '')
}) })
self._events.compiler.register('compilationFinished', function (success, data, source) { self._events.compiler.register('compilationFinished', function finish (success, data, source) {
if (compileIcon) {
var compileTab = document.querySelector('.compileView')
compileTab.style.color = styles.colors.black
compileIcon.style.color = styles.colors.black
compileIcon.classList.remove(`${css.spinningIcon}`)
compileIcon.classList.remove(`${css.bouncingIcon}`)
compileIcon.setAttribute('title', 'idle')
}
// reset the contractMetadata list (used by the publish action) // reset the contractMetadata list (used by the publish action)
self.data.contractsDetails = {} self.data.contractsDetails = {}
// refill the dropdown list // refill the dropdown list
......
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