Jumping groups of slides for previous white arrow.

This commit is contained in:
Mateus Machado Luna 2018-09-21 11:41:57 -03:00
parent 71fa499072
commit 50f80aa351
1 changed files with 11 additions and 1 deletions

View File

@ -349,7 +349,17 @@ export default {
this.$refs.mySwiper.swiper.slideTo(this.slideIndex + amountToSkip);
},
prevGroupOfSlides() {
this.$refs.mySwiper.swiper.navigation.prevEl.click();
let screenWidth = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth);
let amountToSkip = 0;
if (screenWidth <= 480) amountToSkip = 1;
else if (screenWidth > 480 && screenWidth <= 640) amountToSkip = 2;
else if (screenWidth > 640 && screenWidth <= 768) amountToSkip = 4;
else if (screenWidth > 768 && screenWidth <= 1366) amountToSkip = 5;
else if (screenWidth > 1366 && screenWidth <= 1600) amountToSkip = 6;
else if (screenWidth > 1600) amountToSkip = 7;
this.$refs.mySwiper.swiper.slideTo(this.slideIndex - amountToSkip);
},
renderMetadata(itemMetadata, column) {