Skip to content

Commit af8c5fb

Browse files
committed
Use DOMContentLoaded instead of load event
1 parent 5370412 commit af8c5fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
document.body.classList.toggle("sidebar-view");
1414
document.body.classList.toggle("default-view");
1515
}
16-
window.onload = adjustScreen;
17-
window.onresize = adjustScreen;
16+
window.addEventListener("DOMContentLoaded", adjustScreen);
17+
window.addEventListener("resize", adjustScreen);
1818
</script>
1919
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.0/react.js"></script>
2020
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.0/react-dom.js"></script>

0 commit comments

Comments
 (0)