mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Revert "Use onload handler to set giscus theme as soon as it's loaded"
This reverts commit 7eb1426e1f.
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
|
let theme = localStorage.getItem("theme");
|
||||||
|
if (theme != null) {
|
||||||
|
set_theme(theme)
|
||||||
|
}
|
||||||
|
|
||||||
let container = document.querySelector('#toc-aside');
|
let container = document.querySelector('#toc-aside');
|
||||||
if (container != null) {
|
if (container != null) {
|
||||||
resize_toc(container);
|
resize_toc(container);
|
||||||
@@ -91,9 +96,3 @@ function set_giscus_theme(theme) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function giscus_loaded() {
|
|
||||||
let theme = localStorage.getItem("theme");
|
|
||||||
if (theme != null) {
|
|
||||||
set_giscus_theme(theme)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -38,8 +38,7 @@
|
|||||||
data-emit-metadata="1"
|
data-emit-metadata="1"
|
||||||
data-theme="preferred_color_scheme"
|
data-theme="preferred_color_scheme"
|
||||||
crossorigin="anonymous"
|
crossorigin="anonymous"
|
||||||
async
|
async>
|
||||||
onload="giscus_loaded()">
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p class="comment-directly-on-github">
|
<p class="comment-directly-on-github">
|
||||||
|
|||||||
Reference in New Issue
Block a user