From 7c19c6e72ef4f7332da0268319a57743e00343ae Mon Sep 17 00:00:00 2001
From: Flancian <0@flancia.org>
Date: Sun, 15 Nov 2020 02:16:20 +0100
Subject: [PATCH] Dark mode fixed.
---
app/static/js/main.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/static/js/main.js b/app/static/js/main.js
index 5fbd9b1..76fdcf1 100644
--- a/app/static/js/main.js
+++ b/app/static/js/main.js
@@ -18,15 +18,15 @@
document.addEventListener("DOMContentLoaded", function() {
// Select button
const btn = document.querySelector(".theme-toggle");
- // Select the stylesheet
- const theme = document.querySelector("#theme-link");
// Listen for a click on the button
btn.addEventListener("click", function() {
- if (theme.getAttribute("href") == "{{ url_for('static',filename='css/screen-light.css')}}") {
- theme.href = "{{ url_for('static',filename='css/screen-dark.css')}}";
+ // Select the stylesheet
+ var theme = document.querySelector("#theme-link");
+ if (theme.getAttribute("href") == "/static/css/screen-light.css") {
+ theme.href = "/static/css/screen-dark.css";
} else {
- theme.href = "{{ url_for('static',filename='css/screen-light.css')}}";
+ theme.href = "/static/css/screen-light.css";
}
});
});