소스 검색

Use DOMContentLoaded

Riccardo Balbo 4 년 전
부모
커밋
ee5798d5ee
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      static/js/Main.js
  2. 1 1
      static/js/showcase.js
  3. 1 1
      static/js/utils.js

+ 1 - 1
static/js/Main.js

@@ -103,7 +103,7 @@ class GithubService{
 }
 
 
-window.addEventListener("load", function () {
+window.addEventListener("DOMContentLoaded", function () {
 	OpenCollectiveService.init();
 	GithubService.init();
 });

+ 1 - 1
static/js/showcase.js

@@ -129,6 +129,6 @@ const ShowCase=function(showCaseEl){
 
 
 }
-window.addEventListener("load", function () {
+window.addEventListener("DOMContentLoaded", function () {
 	document.querySelectorAll("#showcase").forEach(el=>new ShowCase(el));
 });

+ 1 - 1
static/js/utils.js

@@ -58,7 +58,7 @@ PROGRESS_BAR_INTERVAL = setInterval(function () {
 }, 20);
 
 
-window.addEventListener("load", function () {
+window.addEventListener("DOMContentLoaded", function () {
     document.querySelectorAll(".toggleNavOnPortraitButton").forEach(el=>{
         const toggleId=el.getAttribute("toggle");
         if(!toggleId)return;