Fixed Dark-Mode enabling itself, despite being disabled on reload ... "false" != false ... javascript is trash

This commit is contained in:
Felix Homa 2024-02-08 21:34:43 +01:00
parent 96d140bd2c
commit 4dc9962738
Signed by: felix.homa
GPG Key ID: 43610F311720D3DA
1 changed files with 9 additions and 2 deletions

View File

@ -176,8 +176,15 @@
get_params[sp[0]] = decodeURIComponent(sp[1]); get_params[sp[0]] = decodeURIComponent(sp[1]);
switch(sp[0]) { switch(sp[0]) {
case "inputDarkMode": case "inputDarkMode":
document.getElementById(sp[0]).checked=get_params[sp[0]]; switch(get_params[sp[0]]) {
console.log("Loaded IDM: " + sp[0] + " => " + get_params[sp[0]]); case "true":
document.getElementById(sp[0]).checked=true;
break;
case "false":
document.getElementById(sp[0]).checked=false;
break;
}
console.log("Loaded IDM: " + sp[0] + " => " + document.getElementById(sp[0]).checked);
break; break;
case "inputExamDuration": case "inputExamDuration":
case "inputExtraDuration": case "inputExtraDuration":