From 5c3b9092bff26c932791ab2e48c777c7bccbf615 Mon Sep 17 00:00:00 2001 From: GilbN Date: Fri, 1 Apr 2022 22:03:32 +0200 Subject: [PATCH] fix: :bug: fixes 404 errors when using urlbase --- resources/landing-page/js/scripts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/landing-page/js/scripts.js b/resources/landing-page/js/scripts.js index 80b17ab0..14a3e8f7 100644 --- a/resources/landing-page/js/scripts.js +++ b/resources/landing-page/js/scripts.js @@ -56,7 +56,7 @@ function injectTheme(theme,container="head") { } else html_element = document.body; let themeOption = document.getElementById("theme-option") let link = themeOption ? themeOption : document.createElement("link"); - url = "/css/theme-options" + url = `${window.location.pathname}css/theme-options` link.type = "text/css"; link.rel = "stylesheet"; link.href = `${url}/${themeLower}.css`; @@ -145,7 +145,7 @@ function fadeOutIn(speed) { } function updateMetaThemeColor() { - fetch(`/css/theme-options/${Object.keys(themeOptions)[currentIndex].toLowerCase()}.css`) + fetch(`${window.location.pathname}css/theme-options/${Object.keys(themeOptions)[currentIndex].toLowerCase()}.css`) .then(response => response.text()) .then(text => { let re = text.match("--accent-color:.*;")[0]