remove loading spinner && fix tab dom id

pull/1/head
yann300 7 years ago
parent 5a68fb26ba
commit c4b63e5bb4
  1. 26
      src/app/loading-spinner.js
  2. 19
      src/app/tabbed-menu.js

@ -1,26 +0,0 @@
var yo = require('yo-yo')
// -------------- styling ----------------------
var csjs = require('csjs-inject')
module.exports = loadingSpinner
var css = csjs`
.loader {
display: inline-block;
margin-left: .3em;
border: 2px solid orange;
border-top: 2px solid #F4F6FF; /* Light blue */
border-radius: 50%;
width: 8px;
height: 8px;
animation: spin 2s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
`
function loadingSpinner () {
var el = yo`<div class=${css.loader}></div>`
return el
}

@ -1,5 +1,4 @@
var $ = require('jquery') var $ = require('jquery')
var loadingSpinner = require('./loading-spinner')
module.exports = tabbedMenu module.exports = tabbedMenu
@ -14,23 +13,7 @@ function tabbedMenu (container, appAPI, events, opts) {
}) })
// initialize tabbed menu // initialize tabbed menu
selectTab(container.querySelector('.envView')) selectTab(container.querySelector('.compileView'))
// add event listeners for loading spinner
events.compiler.register('loadingCompiler', function start () {
var settingsTab = document.querySelector('.settingsView')
if (settingsTab.children.length) return
var spinner = loadingSpinner()
settingsTab.appendChild(spinner)
appAPI.warnCompilerLoading('Solidity compiler is currently loading. Please wait a moment...')
events.compiler.register('compilerLoaded', finish)
function finish () {
events.compiler.unregister('compilerLoaded', finish)
settingsTab.removeChild(spinner)
}
})
// select tab // select tab
function selectTab (el) { function selectTab (el) {

Loading…
Cancel
Save