Added preloader to hide elements before they are correctly rendered

This commit is contained in:
n1474335 2017-04-15 20:46:57 +01:00
parent e0e5670d0e
commit a4d93f23d6
16 changed files with 258 additions and 48 deletions

View file

@ -52,6 +52,23 @@ App.prototype.setup = function() {
this.resetLayout();
this.setCompileMessage();
this.loadURIParams();
this.loaded();
};
/**
* Fires once all setup activities have completed.
*/
App.prototype.loaded = function() {
// Trigger CSS animations to remove preloader
document.body.classList.add("loaded");
// Wait for animations to complete then remove the preloader and loaded style
// so that the animations for existing elements don't play again.
setTimeout(function() {
document.getElementById("loader-wrapper").remove();
document.body.classList.remove("loaded");
}, 1000);
};