mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Fix theme stuff
We now wait for CSS to load before reading it and such
This commit is contained in:
@@ -2652,9 +2652,13 @@ function calc_token_usage(
|
|||||||
function Change_Theme(theme) {
|
function Change_Theme(theme) {
|
||||||
var css = document.getElementById("CSSTheme");
|
var css = document.getElementById("CSSTheme");
|
||||||
css.setAttribute("href", "/themes/"+theme+".css");
|
css.setAttribute("href", "/themes/"+theme+".css");
|
||||||
setTimeout(() => {
|
|
||||||
|
// We must wait for the style to load before we read it
|
||||||
|
css.onload = function() {
|
||||||
|
recolorTokens();
|
||||||
create_theming_elements();
|
create_theming_elements();
|
||||||
}, "1000")
|
}
|
||||||
|
|
||||||
setCookie("theme", theme);
|
setCookie("theme", theme);
|
||||||
select = document.getElementById("selected_theme");
|
select = document.getElementById("selected_theme");
|
||||||
for (element of select.childNodes) {
|
for (element of select.childNodes) {
|
||||||
@@ -2664,7 +2668,6 @@ function Change_Theme(theme) {
|
|||||||
element.selected = false;
|
element.selected = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
recolorTokens();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function palette_color(item) {
|
function palette_color(item) {
|
||||||
|
Reference in New Issue
Block a user