From 5737f8613ce2141289dc2e105a7bb6449e3440dd Mon Sep 17 00:00:00 2001 From: Wonderfall Date: Mon, 25 Jul 2022 01:41:59 +0200 Subject: [PATCH] small js change --- assets/js/papermod.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/papermod.js b/assets/js/papermod.js index 800b1897..a1c990e2 100644 --- a/assets/js/papermod.js +++ b/assets/js/papermod.js @@ -43,7 +43,9 @@ function scrollToTop() { } function themeToggle() { - document.getElementById("theme-toggle").addEventListener("click", () => { + var themeButton = document.getElementById("theme-toggle"); + + themeButton.addEventListener("click", () => { if (document.body.className.includes("dark")) { document.body.classList.remove('dark'); localStorage.setItem("pref-theme", 'light');