Skip to content

Commit

Permalink
support a mode where only the thumbnails are visible, until the main …
Browse files Browse the repository at this point in the history
…image viewer is opened by clicking on one -- activated by boolean prop onlyThumbs
  • Loading branch information
wbbaker committed Sep 30, 2024
1 parent e30c4dc commit f4514c9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/Gallery/GalleryImage.global.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<div class="flex flex-col">
<div
v-if="!props.onlyThumbs"
class="flex justify-center border print:hidden bg-base-0 border-base-muted"
>
<GalleryMainImage
Expand All @@ -14,6 +15,9 @@
@select-index="
($event) => {
galleryIndex = $event
// when only showing thumbs, clicking a thumb opens the viewer
if (props.onlyThumbs)
isImageViewerOpen = true
}
"
/>
Expand Down Expand Up @@ -41,6 +45,10 @@ const props = defineProps({
images: {
type: Array,
default: () => []
},
onlyThumbs: {
type: Boolean,
default: false
}
})
Expand Down

0 comments on commit f4514c9

Please sign in to comment.