mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix Chrome onload
This commit is contained in:
@@ -2670,8 +2670,18 @@ function calc_token_usage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Change_Theme(theme) {
|
function Change_Theme(theme) {
|
||||||
var css = document.getElementById("CSSTheme");
|
const oldCSS = $el("#CSSTheme");
|
||||||
css.setAttribute("href", "/themes/"+theme+".css");
|
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
|
// We must wait for the style to load before we read it
|
||||||
css.onload = function() {
|
css.onload = function() {
|
||||||
|
Reference in New Issue
Block a user