mirror of
https://github.com/nextcloud/server.git
synced 2024-08-21 17:55:33 +02:00
fix(weather_status): Always show all favorite locations
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
5bf1fc6535
commit
bab7cc9853
@ -64,21 +64,18 @@
|
||||
@submit="onAddressSubmit">
|
||||
{{ t('weather_status', 'Set custom address') }}
|
||||
</NcActionInput>
|
||||
<NcActionButton v-show="favorites.length > 0"
|
||||
:icon="toggleFavoritesIcon"
|
||||
:aria-hidden="true"
|
||||
@click="showFavorites = !showFavorites">
|
||||
{{ t('weather_status', 'Favorites') }}
|
||||
</NcActionButton>
|
||||
<NcActionButton v-for="favorite in displayedFavorites"
|
||||
:key="favorite"
|
||||
:aria-hidden="true"
|
||||
@click="onFavoriteClick($event, favorite)">
|
||||
<template #icon>
|
||||
<IconStar :size="20" :class="{'favorite-color': address === favorite}" />
|
||||
</template>
|
||||
{{ favorite }}
|
||||
</NcActionButton>
|
||||
<template v-if="favorites.length > 0">
|
||||
<NcActionCaption :title="t('weather_status', 'Favorites')" />
|
||||
<NcActionButton v-for="favorite in favorites"
|
||||
:key="favorite"
|
||||
:aria-hidden="true"
|
||||
@click="onFavoriteClick($event, favorite)">
|
||||
<template #icon>
|
||||
<IconStar :size="20" :class="{'favorite-color': address === favorite}" />
|
||||
</template>
|
||||
{{ favorite }}
|
||||
</NcActionButton>
|
||||
</template>
|
||||
</NcActions>
|
||||
</div>
|
||||
</li>
|
||||
@ -92,6 +89,7 @@ import IconStar from 'vue-material-design-icons/Star.vue'
|
||||
import IconStarOutline from 'vue-material-design-icons/StarOutline.vue'
|
||||
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
|
||||
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
|
||||
import NcActionCaption from '@nextcloud/vue/dist/Components/NcActionCaption.js'
|
||||
import NcActionInput from '@nextcloud/vue/dist/Components/NcActionInput.js'
|
||||
import NcActionLink from '@nextcloud/vue/dist/Components/NcActionLink.js'
|
||||
import NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator.js'
|
||||
@ -211,6 +209,7 @@ export default {
|
||||
IconStar,
|
||||
NcActions,
|
||||
NcActionButton,
|
||||
NcActionCaption,
|
||||
NcActionInput,
|
||||
NcActionLink,
|
||||
NcActionSeparator,
|
||||
@ -236,7 +235,6 @@ export default {
|
||||
forecasts: [],
|
||||
loop: null,
|
||||
favorites: [],
|
||||
showFavorites: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -309,16 +307,6 @@ export default {
|
||||
return f === this.address
|
||||
})
|
||||
},
|
||||
toggleFavoritesIcon() {
|
||||
return this.showFavorites
|
||||
? 'icon-triangle-s'
|
||||
: 'icon-triangle-e'
|
||||
},
|
||||
displayedFavorites() {
|
||||
return this.showFavorites
|
||||
? this.favorites
|
||||
: []
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.initWeatherStatus()
|
||||
|
4
dist/weather_status-weather-status.js
vendored
4
dist/weather_status-weather-status.js
vendored
File diff suppressed because one or more lines are too long
2
dist/weather_status-weather-status.js.map
vendored
2
dist/weather_status-weather-status.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user