diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-06-06 12:36:39 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-06-07 17:47:49 +0200 |
commit | bab7cc98535de34f948931a8da7a0907fa97cea7 (patch) | |
tree | b2668c0eac81271d50d6e31ad8f2c56d9c38977f /apps/weather_status/src | |
parent | 5bf1fc6535a7f4aef8d315e576b91a283d890015 (diff) | |
download | nextcloud-server-bab7cc98535de34f948931a8da7a0907fa97cea7.tar.gz nextcloud-server-bab7cc98535de34f948931a8da7a0907fa97cea7.zip |
fix(weather_status): Always show all favorite locations
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/weather_status/src')
-rw-r--r-- | apps/weather_status/src/App.vue | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/apps/weather_status/src/App.vue b/apps/weather_status/src/App.vue index a5844e2f3ed..ed4aed27ab5 100644 --- a/apps/weather_status/src/App.vue +++ b/apps/weather_status/src/App.vue @@ -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() |