Skip to content

Commit 2cbdddb

Browse files
committed
M
1 parent a1b3d5c commit 2cbdddb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

_includes/footer_custom.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
window.addEventListener('load', function(){
2+
window.addEventListener('DOMContentLoaded', function(){
33
const button = document.getElementById('edit-this-page');
44
const oldUrl = button.href;
55
const newUrl = oldUrl.replace('/main-repo/', '/');

_includes/header_custom.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<a class="site-button" id="theme-toggle" style="cursor: pointer;"></a>
2828

2929
<script>
30-
window.addEventListener('load', function(){
30+
(function(){
3131
const light = 'light';
3232
const dark = 'dark';
3333
const system = 'system';
@@ -89,5 +89,5 @@
8989

9090
button.addEventListener('click', toggleTheme);
9191
setTheme(loadedTheme);
92-
});
92+
})();
9393
</script>

0 commit comments

Comments
 (0)