aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/SettingToggle.vue
diff options
context:
space:
mode:
authorBastien Wirtz <bwirtz@genymobile.com>2020-10-23 15:24:16 -0700
committerBastien Wirtz <bwirtz@genymobile.com>2020-10-23 15:24:16 -0700
commited8b17e0df7ffa64e392bacbd2abf6492fdfb3f1 (patch)
tree361edff077dc7d1796389685a7bfd55ed28473fa /src/components/SettingToggle.vue
parentc368290e32213f537b7b1479d767ee404b0a8399 (diff)
downloadhomer-ed8b17e0df7ffa64e392bacbd2abf6492fdfb3f1.tar.gz
homer-ed8b17e0df7ffa64e392bacbd2abf6492fdfb3f1.tar.zst
homer-ed8b17e0df7ffa64e392bacbd2abf6492fdfb3f1.zip
Update deps & fix lint issues
Diffstat (limited to 'src/components/SettingToggle.vue')
-rw-r--r--src/components/SettingToggle.vue7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/components/SettingToggle.vue b/src/components/SettingToggle.vue
index ffc91a1..985ca84 100644
--- a/src/components/SettingToggle.vue
+++ b/src/components/SettingToggle.vue
@@ -1,6 +1,6 @@
1<template> 1<template>
2 <a v-on:click="toggleSetting()" class="navbar-item is-inline-block-mobile"> 2 <a v-on:click="toggleSetting()" class="navbar-item is-inline-block-mobile">
3 <span><i :class="['fas', 'fa-fw', value ? icon : iconAlt]"></i></span> 3 <span><i :class="['fas', 'fa-fw', value ? icon : secondaryIcon]"></i></span>
4 <slot></slot> 4 <slot></slot>
5 </a> 5 </a>
6</template> 6</template>
@@ -15,13 +15,12 @@ export default {
15 }, 15 },
16 data: function () { 16 data: function () {
17 return { 17 return {
18 secondaryIcon: null,
18 value: true, 19 value: true,
19 }; 20 };
20 }, 21 },
21 created: function () { 22 created: function () {
22 if (!this.iconAlt) { 23 this.secondaryIcon = this.iconAlt || this.icon;
23 this.iconAlt = this.icon;
24 }
25 24
26 if (this.name in localStorage) { 25 if (this.name in localStorage) {
27 this.value = JSON.parse(localStorage[this.name]); 26 this.value = JSON.parse(localStorage[this.name]);