Fixed #6992 - Galleria not showing thumbnails after updating images list

pull/7024/head
tugcekucukoglu 2024-12-27 14:16:02 +03:00
parent c7b0d46233
commit e8ca5141ed
2 changed files with 17 additions and 12 deletions

View File

@ -5,7 +5,7 @@
v-if="showThumbnailNavigators" v-if="showThumbnailNavigators"
v-ripple v-ripple
:class="cx('thumbnailPrevButton')" :class="cx('thumbnailPrevButton')"
:disabled="isNavBackwardDisabled()" :disabled="isNavBackwardDisabled"
type="button" type="button"
:aria-label="ariaPrevButtonLabel" :aria-label="ariaPrevButtonLabel"
@click="navBackward($event)" @click="navBackward($event)"
@ -57,7 +57,7 @@
v-if="showThumbnailNavigators" v-if="showThumbnailNavigators"
v-ripple v-ripple
:class="cx('thumbnailNextButton')" :class="cx('thumbnailNextButton')"
:disabled="isNavForwardDisabled()" :disabled="isNavForwardDisabled"
type="button" type="button"
:aria-label="ariaNextButtonLabel" :aria-label="ariaNextButtonLabel"
@click="navForward($event)" @click="navForward($event)"
@ -507,12 +507,7 @@ export default {
this.documentResizeListener = null; this.documentResizeListener = null;
} }
}, },
isNavBackwardDisabled() {
return (!this.circular && this.d_activeIndex === 0) || this.value.length <= this.d_numVisible;
},
isNavForwardDisabled() {
return (!this.circular && this.d_activeIndex === this.value.length - 1) || this.value.length <= this.d_numVisible;
},
firstItemAciveIndex() { firstItemAciveIndex() {
return this.totalShiftedItems * -1; return this.totalShiftedItems * -1;
}, },
@ -532,6 +527,16 @@ export default {
}, },
ariaNextButtonLabel() { ariaNextButtonLabel() {
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.nextPageLabel : undefined; return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.nextPageLabel : undefined;
},
isNavBackwardDisabled() {
// console.log((!this.circular && this.d_activeIndex === 0) || this.value.length <= this.d_numVisible);
return (!this.circular && this.d_activeIndex === 0) || this.value.length <= this.d_numVisible;
},
isNavForwardDisabled() {
console.log((!this.circular && this.d_activeIndex === this.value.length - 1) || this.value.length <= this.d_numVisible);
return (!this.circular && this.d_activeIndex === this.value.length - 1) || this.value.length <= this.d_numVisible;
} }
}, },
components: { components: {

View File

@ -458,7 +458,7 @@ const classes = {
prevButton: ({ instance }) => [ prevButton: ({ instance }) => [
'p-galleria-prev-button p-galleria-nav-button', 'p-galleria-prev-button p-galleria-nav-button',
{ {
'p-disabled': instance.isNavBackwardDisabled() 'p-disabled': instance.isNavBackwardDisabled
} }
], ],
prevIcon: 'p-galleria-prev-icon', prevIcon: 'p-galleria-prev-icon',
@ -466,7 +466,7 @@ const classes = {
nextButton: ({ instance }) => [ nextButton: ({ instance }) => [
'p-galleria-next-button p-galleria-nav-button', 'p-galleria-next-button p-galleria-nav-button',
{ {
'p-disabled': instance.isNavForwardDisabled() 'p-disabled': instance.isNavForwardDisabled
} }
], ],
nextIcon: 'p-galleria-next-icon', nextIcon: 'p-galleria-next-icon',
@ -484,7 +484,7 @@ const classes = {
thumbnailPrevButton: ({ instance }) => [ thumbnailPrevButton: ({ instance }) => [
'p-galleria-thumbnail-prev-button p-galleria-thumbnail-nav-button', 'p-galleria-thumbnail-prev-button p-galleria-thumbnail-nav-button',
{ {
'p-disabled': instance.isNavBackwardDisabled() 'p-disabled': instance.isNavBackwardDisabled
} }
], ],
thumbnailPrevIcon: 'p-galleria-thumbnail-prev-icon', thumbnailPrevIcon: 'p-galleria-thumbnail-prev-icon',
@ -503,7 +503,7 @@ const classes = {
thumbnailNextButton: ({ instance }) => [ thumbnailNextButton: ({ instance }) => [
'p-galleria-thumbnail-next-button p-galleria-thumbnail-nav-button', 'p-galleria-thumbnail-next-button p-galleria-thumbnail-nav-button',
{ {
'p-disabled': instance.isNavForwardDisabled() 'p-disabled': instance.isNavForwardDisabled
} }
], ],
thumbnailNextIcon: 'p-galleria-thumbnail-next-icon' thumbnailNextIcon: 'p-galleria-thumbnail-next-icon'