diff options
Diffstat (limited to 'src/js/js-loader.js')
-rw-r--r-- | src/js/js-loader.js | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/js/js-loader.js b/src/js/js-loader.js deleted file mode 100644 index cd60baa..0000000 --- a/src/js/js-loader.js +++ /dev/null @@ -1,39 +0,0 @@ -(function() { - 'use strict'; - - document.body.style.display = "none"; - document.addEventListener("DOMContentLoaded", function onDOMReady(e) { - document.removeEventListener(e.type, onDOMReady, false); - - var jsListToLoad = document.querySelector("script[data-jsList]"); - - if (jsListToLoad) { - jsListToLoad = jsListToLoad.getAttribute("data-jsList").trim().split(/\s+/); - } - - if (Array.isArray(jsListToLoad)) { - var loadNextJSFile = function() { - var script, src = jsListToLoad.shift(); - - if (src) { - script = document.createElement("script"); - script.onload = function() { - this.onload = null; - - if (jsListToLoad.length) { - loadNextJSFile(); - } - else { - document.body.style.display = ""; - jsListToLoad = document.querySelector("script[data-jsList]"); - jsListToLoad.parentNode.removeChild(jsListToLoad); - } - }; - document.body.appendChild(script).src = src; - } - }; - - loadNextJSFile(); - } - }, false); -})();
\ No newline at end of file |