fixed gallery next butten disabled
parent
0c652ba778
commit
fc2e437756
|
@ -634,9 +634,7 @@ class SliderComponent extends HTMLElement {
|
|||
}
|
||||
|
||||
initPages() {
|
||||
this.sliderItemsToShow = Array.from(this.sliderItems).filter((element) => { return element.style.display !== 'none' });
|
||||
|
||||
console.log('sliderItemsToShow', this.sliderItemsToShow);
|
||||
this.sliderItemsToShow = Array.from(this.sliderItems).filter((element) => element.clientWidth > 0);
|
||||
|
||||
if (this.sliderItemsToShow.length < 2) return;
|
||||
|
||||
|
@ -648,20 +646,12 @@ class SliderComponent extends HTMLElement {
|
|||
|
||||
this.totalPages = this.sliderItemsToShow.length - this.slidesPerPage + 1;
|
||||
|
||||
console.log('totalPages', this.totalPages);
|
||||
|
||||
this.update();
|
||||
}
|
||||
|
||||
resetPages() {
|
||||
setTimeout(() => {
|
||||
this.slider = this.querySelector('[id^="Slider-"]');
|
||||
this.sliderItems = this.querySelectorAll('[id^="Slide-"]');
|
||||
this.initPages();
|
||||
|
||||
console.log('resetPages', this.totalPages, this.currentPage, this.slider.scrollLeft, this.sliderItemOffset);
|
||||
console.log("resetPages this", this);
|
||||
}, 500);
|
||||
this.sliderItems = this.querySelectorAll('[id^="Slide-"]');
|
||||
this.initPages();
|
||||
}
|
||||
|
||||
update() {
|
||||
|
@ -672,8 +662,6 @@ class SliderComponent extends HTMLElement {
|
|||
const previousPage = this.currentPage;
|
||||
this.currentPage = Math.round(this.slider.scrollLeft / this.sliderItemOffset) + 1;
|
||||
|
||||
console.log('currentPage', this.currentPage, 'totalPages', this.totalPages, 'previousPage', previousPage);
|
||||
|
||||
if (this.currentPageElement && this.pageTotalElement) {
|
||||
this.currentPageElement.textContent = this.currentPage;
|
||||
this.pageTotalElement.textContent = this.totalPages;
|
||||
|
|
Loading…
Reference in New Issue