Skip to content

Commit bf9607e

Browse files
petermetzalsorokin
authored andcommitted
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.
1 parent 87d29ad commit bf9607e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/browser/SplashScreenProxy.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var SplashScreen = {
6767
localSplash = document.createElement("div");
6868
localSplash.style.backgroundColor = bgColor;
6969
localSplash.style.position = "absolute";
70+
localSplash.style["z-index"] = "99999";
7071

7172
localSplashImage = document.createElement("img");
7273
localSplashImage.src = imageSrc;
@@ -81,8 +82,19 @@ var SplashScreen = {
8182
hide: function () {
8283
if(localSplash) {
8384
window.removeEventListener("resize", onResize, false);
84-
document.body.removeChild(localSplash);
85-
localSplash = null;
85+
86+
localSplash.style.opacity = '0';
87+
localSplash.style["-webkit-transition"] = "opacity 1s ease-in-out";
88+
localSplash.style["-moz-transition"] = "opacity 1s ease-in-out";
89+
localSplash.style["-ms-transition"] = "opacity 1s ease-in-out";
90+
localSplash.style["-o-transition"] = "opacity 1s ease-in-out";
91+
92+
window.setTimeout(function () {
93+
document.body.removeChild(localSplash);
94+
localSplash = null;
95+
}, 1000);
96+
97+
8698
}
8799
}
88100
};

0 commit comments

Comments
 (0)