|
|
|
@ -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() |
|
|
|
|