reset tags in gallery-list upon navigation
This commit is contained in:
parent
cc5b5bbe74
commit
25cfec981e
1 changed files with 13 additions and 1 deletions
|
@ -30,7 +30,7 @@ const globalConfig = routeStore._globals
|
|||
const storageId = `${globalConfig.id}`
|
||||
const router = useRouter()
|
||||
let config: GalleryList = null!
|
||||
const tagsToggled: string[] = []
|
||||
let tagsToggled: string[] = []
|
||||
|
||||
const ready = ref(false)
|
||||
const galleryReady = ref(false)
|
||||
|
@ -62,6 +62,7 @@ const onLoadTags = () => {
|
|||
* Handles updating the displayed entries in the list
|
||||
*/
|
||||
const onDisplayEntries = () => {
|
||||
resetTags()
|
||||
galleryReady.value = false
|
||||
let currentEntries = config.entries
|
||||
if (!!variants.value) {
|
||||
|
@ -153,6 +154,17 @@ const onToggleTag = (event: Event, tagId: string) => {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the `hidden` state of entries
|
||||
* and the `tagsToggled` array
|
||||
*/
|
||||
const resetTags = () => {
|
||||
Object.keys(entries.value).forEach(entryId => {
|
||||
entries.value[entryId].hidden = false
|
||||
})
|
||||
tagsToggled = []
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
ready.value = false
|
||||
config = await fetchAndParseYaml<GalleryList>(routeConfig.config)
|
||||
|
|
Loading…
Add table
Reference in a new issue