Merge pull request #219 from one-some/UI2

Fix chrome onload for themes
This commit is contained in:
ebolam
2022-10-16 12:19:11 -04:00
committed by GitHub

View File

@@ -2670,8 +2670,18 @@ function calc_token_usage(
}
function Change_Theme(theme) {
var css = document.getElementById("CSSTheme");
css.setAttribute("href", "/themes/"+theme+".css");
const oldCSS = $el("#CSSTheme");
if (oldCSS) oldCSS.remove();
const css = $e(
"link",
document.head,
{
id: "CSSTheme",
rel: "stylesheet",
href: `/themes/${theme}.css`
}
);
// We must wait for the style to load before we read it
css.onload = function() {