allow dark mode changes to be immediate and not require page reload

This commit is contained in:
Stewart Allen 2020-07-08 15:36:46 -04:00
commit c4bee0b762
3 changed files with 20 additions and 11 deletions

View file

@ -88,7 +88,6 @@
function booleanSave() {
let control = settings().controller;
let isDark = control.dark;
let isReload = false;
control.expert = UI.expert.checked;
control.showOrigin = UI.showOrigin.checked;
control.autoLayout = UI.autoLayout.checked;
@ -104,14 +103,8 @@
platform.layout();
platform.update_stock();
API.conf.save();
// if dark mode changed, reload UI
if (isDark !== control.dark) {
isReload = true;
}
API.mode.set_expert(control.expert);
if (isReload) {
API.space.reload();
}
API.platform.update_size();
}
function onLayerToggle() {