mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 09:14:30 +00:00
Web UI options faff
This commit is contained in:
@@ -163,11 +163,16 @@ function setColorScheme(mode) {
|
||||
|
||||
// Startup function to determine whether to use light or dark mode, or leave as auto
|
||||
function usePreferredTheme() {
|
||||
// Set the value of the select box to the server's default
|
||||
$("#color-scheme").val(web_ui_options["default-color-scheme"]);
|
||||
|
||||
// Work out if we have ever explicitly saved the value of our select box. If so, we set our colour scheme now based
|
||||
// on that. If not, we let the select retain its default value of "auto".
|
||||
// on that. If not, we let the select retain its default value from Spothole config and apply that.
|
||||
let val = localStorage.getItem("#color-scheme:value");
|
||||
if (val != null) {
|
||||
setColorScheme(JSON.parse(val));
|
||||
} else {
|
||||
setColorSchemeFromUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user