aboutsummaryrefslogtreecommitdiff
path: root/src/App.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-29 17:32:14 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-29 17:32:14 +1000
commit9d01f0f1691ec04a06bead7d9bf834c47c9a93d8 (patch)
tree8ea3c466e16038a856598f1a46a5cafd07537b25 /src/App.vue
parent06aa08b1de6bdb60203231d5c22816a6c9c4cee4 (diff)
Add saved-indicator to Settings
Also, for range sliders, only save after user releases the slider
Diffstat (limited to 'src/App.vue')
-rw-r--r--src/App.vue11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/App.vue b/src/App.vue
index 1937997..fa8ddcd 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -720,20 +720,23 @@ export default defineComponent({
this.resetMode();
this.settingsOpen = true;
},
- async onSettingChg(optionType: OptionType, option: string){
+ async onSettingChg(optionType: OptionType, option: string, save = true){
// Save in localStorage
if (optionType == 'LYT'){
- localStorage.setItem(`${optionType} ${option}`, String(this.lytOpts[option as keyof LayoutOptions]));
+ if (save){
+ localStorage.setItem(`${optionType} ${option}`, String(this.lytOpts[option as keyof LayoutOptions]));
+ }
this.relayoutWithCollapse();
} else if (optionType == 'UI') {
- localStorage.setItem(`${optionType} ${option}`, String(this.uiOpts[option as keyof UiOptions]));
+ if (save){
+ localStorage.setItem(`${optionType} ${option}`, String(this.uiOpts[option as keyof UiOptions]));
+ }
if (option == 'useReducedTree'){
this.onTreeChange();
}
} else {
throw new Error(`Unexpected setting: ${optionType}, ${option}`);
}
- console.log(`Saved setting: ${optionType}, ${option}`);
},
async onTreeChange(){
if (this.activeRoot != this.layoutTree){