Improvement on startup showing boxes more time

This commit is contained in:
Luis Fernando Molina committed 2020-05-12 13:33:30 +02:00
1 parent f88450ddd7
commit 082f388d2c
13 files changed
+36 -18

No files matched your search

+7 -4
View File
@@ -13,7 +13,7 @@ function newSplashScreen () {
initialize: initialize
}
var container = newContainer()
let container = newContainer()
container.initialize()
thisObject.container = container
@@ -31,21 +31,22 @@ function newSplashScreen () {
let logo
let canDrawLogo = false
let isInitialized = false
let splashScreenNeeded = true
return thisObject
function initialize () {
logo = new Image()
logo.onload = onImageLoad
function onImageLoad () {
canDrawLogo = true
}
logo.src = window.canvasApp.urlPrefix + 'Images/superalgos-logo.png'
canvas.eventHandler.listenToEvent('Browser Resized', resize)
isInitialized = true
}
function resize () {
@@ -54,6 +55,7 @@ function newSplashScreen () {
}
function draw () {
if (isInitialized === false) { return }
if (splashScreenNeeded === false) {
stepsInitializationCounter = 100
canDrawLogo = false
@@ -101,6 +103,7 @@ function newSplashScreen () {
if (stepsInitializationCounter > 99) {
splashScreenNeeded = false
canWeDraw = true
stepsInitializationCounter = 99
}