Added preloader to hide elements before they are correctly rendered

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

No files matched your search

+17
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);
};