From 7cfdc4f1c4ca5be656a05d387b5c7ac07de0e3bf Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 29 Sep 2019 13:29:47 +0200 Subject: [PATCH] Fixed relative path issue with theme switcher, changed to absolute path --- js/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 72b5cf7..fb58499 100644 --- a/js/main.js +++ b/js/main.js @@ -39,17 +39,21 @@ function reorganize_html() { function create_theme_switcher() { // set the correct CSS depending on the cookie, dark is default var light = isThemeLight(); + // Set the correct symbol in the theme switcher button $('body').append('
')); + // set the correct css file in the HTML head $('head').append('')); // switch CSS files and button icon, set new cookie on theme switcher click $('.themeBtn').click(function() { var light = !isThemeLight(); - $("#theme").first().attr('href', './css/' + // Switch the CSS between light and dark + $("#theme").first().attr('href', 'https://langue.phundrak.fr/css/' .concat(light ? 'light' : 'dark') .concat('.css')); + // Switch the icon in the theme switcher button $('.themeBtn').html(''));