From cef9b43710ec4efacf3a06a52d081e24f679c49b Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Thu, 29 Nov 2018 14:49:07 -0200 Subject: [PATCH] Fixes slideshow second image to reaload first image. --- src/theme-helper/view-mode-slideshow.vue | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/theme-helper/view-mode-slideshow.vue b/src/theme-helper/view-mode-slideshow.vue index 7fa5d0d77..69af08e7c 100644 --- a/src/theme-helper/view-mode-slideshow.vue +++ b/src/theme-helper/view-mode-slideshow.vue @@ -379,7 +379,8 @@ export default { this.slideIndex = updatedSlideIndex; // console.log("Após: " + this.slideIndex + " " + this.$refs.mySwiper.swiper.activeIndex); - } + } + } } @@ -413,9 +414,9 @@ export default { this.$refs.mySwiper.swiper.activeIndex = this.slideIndex + 0; } else if (this.slideItems.length > 0) { - if (this.$refs.mySwiper.swiper.activeIndex == this.slideItems.length - 1 && this.page < this.totalPages) + if (this.$refs.mySwiper.swiper.activeIndex == this.slideItems.length - 1 && this.page < this.totalPages) { oldVal == undefined ? this.$eventBusSearch.setPage(this.page + 1) : this.$eventBusSearch.setPage(this.maxPage + 1); - else if (this.$refs.mySwiper.swiper.activeIndex == 0 && this.page > 1 && this.slideItems.length < this.totalItems) { + } else if (this.$refs.mySwiper.swiper.activeIndex == 0 && this.page > 1 && this.slideItems.length < this.totalItems) { oldVal == undefined ? this.$eventBusSearch.setPage(this.page - 1) : this.$eventBusSearch.setPage(this.minPage - 1); } } @@ -478,18 +479,14 @@ export default { this.$nextTick(() => { if (this.readjustedSlideIndex != undefined) { - this.slideIndex = this.readjustedSlideIndex; - // if (this.slideIndex != undefined && this.$refs.mySwiper.swiper.slides[this.slideIndex] != undefined) - // this.$refs.mySwiper.swiper.slides[this.slideIndex].click(); - this.$refs.mySwiper.swiper.activeIndex = this.slideIndex + 0; + + if (this.slideIndex != undefined && this.$refs.mySwiper.swiper.slides[this.readjustedSlideIndex] != undefined) + this.$refs.mySwiper.swiper.slides[this.readjustedSlideIndex].click(); + this.readjustedSlideIndex = undefined; - - if (this.slideIndex != undefined && this.$refs.mySwiper.swiper.slides[this.slideIndex] != undefined) - this.$refs.mySwiper.swiper.slides[this.slideIndex].click(); - } }); - + }, nextSlide() { if (this.$refs.mySwiper.swiper != undefined) @@ -536,7 +533,6 @@ export default { } }, loadCurrentItem() { - if ((this.slideItems && this.slideItems[this.slideIndex] && this.slideItems[this.slideIndex].id != undefined)) { this.isLoadingItem = true;