Skip to content

Commit

Permalink
Fixed #1523 - Thumbnails are not displayed correctly on Galleria if n…
Browse files Browse the repository at this point in the history
…umVisible is greater than the length of value
  • Loading branch information
mertsincan committed Sep 8, 2021
1 parent f5226f6 commit e274666
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/galleria/Galleria.vue
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export default {
.p-galleria-thumbnail-items-container {
overflow: hidden;
width: 100%;
}
.p-galleria-thumbnail-items {
Expand Down
11 changes: 10 additions & 1 deletion src/components/galleria/GalleriaContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@start-slideshow="startSlideShow" @stop-slideshow="stopSlideShow" />

<GalleriaThumbnails v-if="$attrs.showThumbnails" :containerId="id" :value="$attrs.value" v-model:activeIndex="activeIndex" :templates="$attrs.templates"
:numVisible="$attrs.numVisible" :responsiveOptions="$attrs.responsiveOptions" :circular="$attrs.circular"
:numVisible="numVisible" :responsiveOptions="$attrs.responsiveOptions" :circular="$attrs.circular"
:isVertical="isVertical()" :contentHeight="$attrs.verticalThumbnailViewPortHeight" :showThumbnailNavigators="$attrs.showThumbnailNavigators"
v-model:slideShowActive="slideShowActive" @stop-slideshow="stopSlideShow" />
</div>
Expand All @@ -39,12 +39,21 @@ export default {
return {
id: this.$attrs.id || UniqueComponentId(),
activeIndex: this.$attrs.activeIndex,
numVisible: this.$attrs.numVisible,
slideShowActive: false
}
},
watch: {
'$attrs.value': function(newVal) {
if (newVal && newVal.length < this.numVisible) {
this.numVisible = newVal.length;
}
},
'$attrs.activeIndex': function(newVal) {
this.activeIndex = newVal;
},
'$attrs.numVisible': function(newVal) {
this.numVisible = newVal;
}
},
updated() {
Expand Down

0 comments on commit e274666

Please sign in to comment.