From fa6106a6bb5a9daa1768a118877b7ba345462180 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 21 Dec 2017 18:21:10 +0100 Subject: [PATCH] Use CSS to remove the loading screen --- customize.dist/src/less2/loading.less | 7 +++++++ www/common/common-interface.js | 6 ++++-- www/common/loading.js | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/customize.dist/src/less2/loading.less b/customize.dist/src/less2/loading.less index e13a56de6..8c7e8f5e4 100644 --- a/customize.dist/src/less2/loading.less +++ b/customize.dist/src/less2/loading.less @@ -7,6 +7,9 @@ The CSS inside of loading.js is precompiled in order to save 200ish milliseconds @import (once) "./include/browser.less"; #cp-loading { + transition: opacity 0.75s, visibility 0s 0.75s; + visibility: visible; + opacity: 1; position: fixed; z-index: 10000000; // #loading top: 0px; @@ -37,6 +40,10 @@ The CSS inside of loading.js is precompiled in order to save 200ish milliseconds height: 100px; } } + &.cp-loading-hidden { + opacity: 0; + visibility: hidden; + } } #cp-loading-tip { position: fixed; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index a311214fa..85e1236f7 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -434,7 +434,8 @@ define([ var hideLogo = config.hideLogo; var $loading, $container; if ($('#' + LOADING).length) { - $loading = $('#' + LOADING).show(); + $loading = $('#' + LOADING); //.show(); + $loading.removeClass('cp-loading-hidden'); if (loadingText) { $('#' + LOADING).find('p').text(loadingText); } @@ -465,7 +466,8 @@ define([ // This test is created in sframe-boot2.js if (Test.__ASYNC_BLOCKER__) { Test.__ASYNC_BLOCKER__.pass(); } - $('#' + LOADING).fadeOut(750, cb); + $('#' + LOADING).addClass("cp-loading-hidden"); + //$('#' + LOADING).fadeOut(750, cb); var $tip = $('#cp-loading-tip').css('top', '') // loading.less sets transition-delay: $wait-time // and transition: opacity $fadeout-time diff --git a/www/common/loading.js b/www/common/loading.js index a613554d2..a5f96b62a 100644 --- a/www/common/loading.js +++ b/www/common/loading.js @@ -1,6 +1,8 @@ define([], function () { var loadingStyle = (function(){/* #cp-loading { + transition: opacity 0.75s, visibility 0s 0.75s; + visibility: visible; position: fixed; z-index: 10000000; top: 0px; @@ -11,6 +13,11 @@ define([], function () { color: #fafafa; text-align: center; font-size: 1.5em; + opacity: 1; +} +#cp-loading.cp-loading-hidden { + opacity: 0; + visibility: hidden; } #cp-loading .cp-loading-container { margin-top: 50vh;