Browse Source

injectTheme fix

pull/270/head
GilbN 3 years ago
parent
commit
317da9022c
  1. 5
      Resources/landing-page/js/scripts.js

5
Resources/landing-page/js/scripts.js

@ -79,12 +79,13 @@ function injectTheme(theme,container="head") {
if (container === "head") { if (container === "head") {
html_element = document.head; html_element = document.head;
} else html_element = document.body; } else html_element = document.body;
let link = document.createElement("link"); let themeOption = document.getElementById("theme-option")
let link = themeOption ? themeOption : document.createElement("link");
url = "/CSS/variables/" url = "/CSS/variables/"
link.type = "text/css"; link.type = "text/css";
link.rel = "stylesheet"; link.rel = "stylesheet";
link.href = `${url}/${theme.toLowerCase()}.css`; link.href = `${url}/${theme.toLowerCase()}.css`;
link.id = `theme-option`
html_element.appendChild(link); html_element.appendChild(link);
} }

Loading…
Cancel
Save