mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Miscellaneous lint fixes: move watch & mounted properties; apply automatic fixes (#12791)
* commit lint's automatic fixes * move watch and mounted properties as advised in lint warnings
This commit is contained in:
@@ -384,16 +384,6 @@ export default {
|
||||
memberResults: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'challenge.name': {
|
||||
handler (newVal) {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
section: this.$t('challenge'),
|
||||
subSection: newVal.name,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState({ user: 'user.data' }),
|
||||
isMember () {
|
||||
@@ -410,6 +400,16 @@ export default {
|
||||
return !this.isMember;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
'challenge.name': {
|
||||
handler (newVal) {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
section: this.$t('challenge'),
|
||||
subSection: newVal.name,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
if (!this.searchId) this.searchId = this.challengeId;
|
||||
if (!this.challenge._id) this.loadChallenge();
|
||||
|
||||
@@ -56,8 +56,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</filter-group>
|
||||
<filter-group :title="$t('membership')"
|
||||
<filter-group
|
||||
v-if="$route.name !== 'findChallenges'"
|
||||
:title="$t('membership')"
|
||||
class="form-group"
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -496,17 +496,17 @@ export default {
|
||||
return this.groups.some(g => g.selected);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
searchText: throttle(function throttleSearch () {
|
||||
this.searchTextThrottled = this.searchText.toLowerCase();
|
||||
}, 250),
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
subSection: this.$t('items'),
|
||||
section: this.$t('inventory'),
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
searchText: throttle(function throttleSearch () {
|
||||
this.searchTextThrottled = this.searchText.toLowerCase();
|
||||
}, 250),
|
||||
},
|
||||
methods: {
|
||||
userHasPet (potionKey, eggKey) {
|
||||
const animalKey = `${eggKey}-${potionKey}`;
|
||||
|
||||
@@ -645,12 +645,6 @@ export default {
|
||||
return Object.values(this.viewOptions).some(g => g.selected);
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
subSection: this.$t('stable'),
|
||||
section: this.$t('inventory'),
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
searchText: _throttle(function throttleSearch () {
|
||||
const search = this.searchText.toLowerCase();
|
||||
@@ -662,6 +656,12 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
subSection: this.$t('stable'),
|
||||
section: this.$t('inventory'),
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
setShowMore (key) {
|
||||
this.$_openedItemRows_toggleByType(key, !this.$_openedItemRows_isToggled(key));
|
||||
|
||||
@@ -1,37 +1,38 @@
|
||||
<template>
|
||||
<filter-sidebar>
|
||||
<filter-group>
|
||||
<checkbox :checked.sync="viewOptionEntry.selected"
|
||||
<checkbox
|
||||
v-for="(viewOptionEntry, viewOptionKey) in viewOptions"
|
||||
:id="`category-${viewOptionKey}`"
|
||||
:key="viewOptionKey"
|
||||
:checked.sync="viewOptionEntry.selected"
|
||||
:text="viewOptionEntry.text"
|
||||
v-for="(viewOptionEntry, viewOptionKey) in viewOptions"
|
||||
/>
|
||||
</filter-group>
|
||||
<div class="form-group clearfix">
|
||||
<h3
|
||||
class="float-left"
|
||||
v-once
|
||||
class="float-left"
|
||||
>
|
||||
{{ $t('hideLocked') }}
|
||||
</h3>
|
||||
<toggle-switch
|
||||
@change="$emit('update:hideLocked', $event)"
|
||||
class="float-right"
|
||||
v-model="lockedChecked"
|
||||
class="float-right"
|
||||
@change="$emit('update:hideLocked', $event)"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group clearfix">
|
||||
<h3
|
||||
class="float-left"
|
||||
v-once
|
||||
class="float-left"
|
||||
>
|
||||
{{ $t('hidePinned') }}
|
||||
</h3>
|
||||
<toggle-switch
|
||||
@change="$emit('update:hidePinned', $event)"
|
||||
class="float-right"
|
||||
v-model="pinnedChecked"
|
||||
class="float-right"
|
||||
@change="$emit('update:hidePinned', $event)"
|
||||
/>
|
||||
</div>
|
||||
</filter-sidebar>
|
||||
|
||||
@@ -491,16 +491,16 @@ export default {
|
||||
return tagsByType;
|
||||
},
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
section: this.$t('tasks'),
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
searchText: throttle(function throttleSearch () {
|
||||
this.searchTextThrottled = this.searchText.toLowerCase();
|
||||
}, 250),
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('common:setTitle', {
|
||||
section: this.$t('tasks'),
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
...mapActions({ setUser: 'user:set' }),
|
||||
checkMouseOver: throttle(function throttleSearch () {
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
<template>
|
||||
<span>
|
||||
<span class="dropdown-label">{{ label }}</span>
|
||||
<select-list :items="items"
|
||||
<select-list
|
||||
:items="items"
|
||||
:value="selectedItem"
|
||||
class="array-select inline"
|
||||
:right="true"
|
||||
key-prop="id"
|
||||
:hide-icon="false"
|
||||
:inline-dropdown="false"
|
||||
@select="selectItem($event)">
|
||||
@select="selectItem($event)"
|
||||
>
|
||||
<template v-slot:item="{ item }">
|
||||
<span :class="{'dropdown-icon-item': withIcon}">
|
||||
<slot
|
||||
|
||||
Reference in New Issue
Block a user