diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-06-19 19:57:49 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-06-19 19:57:49 +1000 |
| commit | 6ff4615cf8734eec2422a573b6e96b9db1f322f2 (patch) | |
| tree | 77ac42fc87d601731214e87040c3325377b1d7f0 /src/components/SettingsModal.vue | |
| parent | fb8a1874b549aa8df755880ba8d013684ab7d1c1 (diff) | |
Automatically save settings changes
Diffstat (limited to 'src/components/SettingsModal.vue')
| -rw-r--r-- | src/components/SettingsModal.vue | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/components/SettingsModal.vue b/src/components/SettingsModal.vue index 595b145..3a8f34a 100644 --- a/src/components/SettingsModal.vue +++ b/src/components/SettingsModal.vue @@ -13,6 +13,7 @@ export default defineComponent({ methods: { onCloseClick(evt: Event){ if (evt.target == this.$el || (this.$refs.closeIcon as typeof CloseIcon).$el.contains(evt.target)){ + this.saveSettings(); this.$emit('settings-close'); } }, @@ -38,7 +39,7 @@ export default defineComponent({ onTreeChg(){ this.$emit('tree-change'); }, - onSave(){ + saveSettings(){ const savedLytOpts = ['tileSpacing', 'minTileSz', 'maxTileSz', 'layoutType', 'sweepMode', 'sweepToParent', ]; for (let prop of savedLytOpts){ localStorage.setItem('lyt ' + prop, String(this.lytOpts[prop as keyof LayoutOptions])); @@ -170,9 +171,6 @@ export default defineComponent({ </div> <hr class="border-stone-400"/> <div class="flex justify-around mt-2"> - <r-button class="bg-stone-800 text-white" @click="onSave"> - Save - </r-button> <r-button class="bg-stone-800 text-white" @click="onReset"> Reset </r-button> |
