Skip to content

Commit

Permalink
Remove doubbled register and move cb outside of register function
Browse files Browse the repository at this point in the history
  • Loading branch information
ninabreznik committed May 19, 2017
1 parent 22cb31f commit 777fcf9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/app/tabbed-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ function tabbedMenu (compiler, loadingSpinner, self) {
// initialize tabbed menu
selectTab($('#options .envView'))

function cb (finish) {
compiler.event.register('compilerLoaded', finish)
}
// add event listeners for loading spinner
// compiler.event.register('compilationStarted', function compilationStarted () {
compiler.event.register('loadingCompiler', function compilationStarted () {
var contractTab = document.querySelector('.envView')
if (!contractTab.children.length) {
contractTab.appendChild(loadingSpinner(function cb (finish) {
// compiler.event.register('compilationFinished', function () {
compiler.event.register('compilerLoaded', finish)
}))
contractTab.appendChild(loadingSpinner(cb))
}
})
compiler.event.register('loadingCompiler', function loadingCompiler () {
var settingsTab = document.querySelector('.settingsView')
if (!settingsTab.children.length) {
settingsTab.appendChild(loadingSpinner(function cb (finish) {
Expand Down

0 comments on commit 777fcf9

Please sign in to comment.