fix normalize.css applying a [hidden[ { display: hidden; } rule due to v-bind reflecting the hidden field

This commit is contained in:
lightling 2024-05-30 19:16:39 -04:00
parent c05143cf2c
commit 46b1732c24
2 changed files with 11 additions and 11 deletions

View file

@ -23,7 +23,7 @@ type GalleryDisplayedEntries = { [idOrTitle: string]: GalleryEntry & {
/**
* specifies whether the entry is hidden by the tags selected by a visitor
*/
hidden?: boolean
isHidden?: boolean
}}
const props = defineProps<{
@ -132,11 +132,11 @@ const onHideWarningsToggled = (event: Event) => {
const onToggledTagsChanged = (tagsToggled: string[]) => {
if (tagsToggled.length < 1) {
Object.keys(entries.value).forEach(entryId => {
entries.value[entryId].hidden = false
entries.value[entryId].isHidden = false
})
} else {
Object.keys(entries.value).forEach(entryId => {
entries.value[entryId].hidden = !entries.value[entryId].tags?.some(own => tagsToggled.includes(own))
entries.value[entryId].isHidden = !entries.value[entryId].tags?.some(own => tagsToggled.includes(own))
})
}
}
@ -150,7 +150,7 @@ const resetTags = () => {
filterPanelRef.value.resetTags()
}
Object.keys(entries.value).forEach(entryId => {
entries.value[entryId].hidden = false
entries.value[entryId].isHidden = false
})
}
@ -203,8 +203,8 @@ onMounted(async () => {
v-for='(entry, id) in entries'
)
GalleryTile(
v-if='!entry.hidden || !config.removeFromView'
:class='{ hidden: entry.hidden && !config.removeFromView }'
v-if='!entry.isHidden || !config.removeFromView'
:class='{ hidden: entry.isHidden && !config.removeFromView }'
:entry='entry'
:id='id'
:hideWarnings='hideWarnings'

View file

@ -21,7 +21,7 @@ import ProjectTile from './project-tile.vue'
/**
* specifies whether the entry is hidden by the tags selected by a visitor
*/
hidden?: boolean
isHidden?: boolean
}}
const projectIds = ref([] as string[])
@ -41,11 +41,11 @@ const projectViewPath = computed(() => `${currentRoute.path}/view`)
const onToggledTagsChanged = (tagsToggled: string[]) => {
if (tagsToggled.length < 1) {
Object.keys(projects.value).forEach(entryId => {
projects.value[entryId].hidden = false
projects.value[entryId].isHidden = false
})
} else {
Object.keys(projects.value).forEach(entryId => {
projects.value[entryId].hidden = !projects.value[entryId].tags?.some(own => tagsToggled.includes(own))
projects.value[entryId].isHidden = !projects.value[entryId].tags?.some(own => tagsToggled.includes(own))
})
}
}
@ -72,9 +72,9 @@ onMounted(async () => {
v-for='id in projectIds'
)
ProjectTile(
v-if='!projects[id].hidden || !config.removeFromView'
v-if='!projects[id].isHidden || !config.removeFromView'
v-bind='projects[id]'
:class='{ hidden: projects[id].hidden && !config.removeFromView }'
:class='{ hidden: projects[id].isHidden && !config.removeFromView }'
:id='id'
:viewPath='projectViewPath'
:isInternal='true'