Browse Source

fix: preloader element issue

Torkel Ödegaard 7 năm trước cách đây
mục cha
commit
abefadb333
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      public/views/index.template.html

+ 4 - 1
public/views/index.template.html

@@ -275,7 +275,10 @@
     document.head.insertBefore(myCSS, document.head.childNodes[document.head.childNodes.length - 1].nextSibling);
     // switch loader to show all has loaded
     window.onload = function() {
-      document.getElementsByClassName("preloader")[0].className = "preloader preloader--done";
+      var preloader = document.getElementsByClassName("preloader");
+      if (preloader.length) {
+        preloader[0].className = "preloader preloader--done";
+      }
     };
   </script>