From bf9607e27f2f74d9a38b3172bd3f1accfdba2c59 Mon Sep 17 00:00:00 2001 From: "Peter (Somogyvari) Metz" Date: Sun, 26 Jun 2016 11:49:08 +0100 Subject: [PATCH] CB-11488 (browser) Added a 1 second long fade out to the splash screen instead of the hard remove from the DOM whenever hide() is called. Also made a high z-index the default. This could be added from the user's stylesheets but if that only gets parsed later, there may be flickering between the application UI and the splash screen itself. --- src/browser/SplashScreenProxy.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/browser/SplashScreenProxy.js b/src/browser/SplashScreenProxy.js index ae38b2e..cd3b7fd 100644 --- a/src/browser/SplashScreenProxy.js +++ b/src/browser/SplashScreenProxy.js @@ -67,6 +67,7 @@ var SplashScreen = { localSplash = document.createElement("div"); localSplash.style.backgroundColor = bgColor; localSplash.style.position = "absolute"; + localSplash.style["z-index"] = "99999"; localSplashImage = document.createElement("img"); localSplashImage.src = imageSrc; @@ -81,8 +82,19 @@ var SplashScreen = { hide: function () { if(localSplash) { window.removeEventListener("resize", onResize, false); - document.body.removeChild(localSplash); - localSplash = null; + + localSplash.style.opacity = '0'; + localSplash.style["-webkit-transition"] = "opacity 1s ease-in-out"; + localSplash.style["-moz-transition"] = "opacity 1s ease-in-out"; + localSplash.style["-ms-transition"] = "opacity 1s ease-in-out"; + localSplash.style["-o-transition"] = "opacity 1s ease-in-out"; + + window.setTimeout(function () { + document.body.removeChild(localSplash); + localSplash = null; + }, 1000); + + } } };