From 7c7acd0d5bb0bcdb68ef508e03fe4be683b47bc5 Mon Sep 17 00:00:00 2001 From: alexisben <alex@noesya.coop> Date: Mon, 16 Jan 2023 17:46:43 +0100 Subject: [PATCH] fix testimonial pagination #63 --- assets/js/vendors/carousel.js | 18 +++++++++--------- assets/sass/_theme/blocks/testimonials.sass | 4 ++++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/assets/js/vendors/carousel.js b/assets/js/vendors/carousel.js index 0da736c6..eb86fbe6 100644 --- a/assets/js/vendors/carousel.js +++ b/assets/js/vendors/carousel.js @@ -33,39 +33,39 @@ class Carousel { stepButton.innerHTML = '<i></i>'; }); - this.splide.on('autoplay:play', function () { + this.splide.on('autoplay:play', () => { toggleButton.classList.add('is-active'); }); - this.splide.on('autoplay:playing', function (rate) { + this.splide.on('autoplay:playing', (rate) => { var activeStepButton = this.splide.root.querySelector('.splide__pagination .is-active i'); activeStepButton.style.width = rate * 100 + '%'; }); - this.splide.on('autoplay:pause', function () { + this.splide.on('autoplay:pause', () => { toggleButton.classList.remove('is-active'); }); - elements.forEach(function(element) { + elements.forEach(element => { element.addEventListener('click', () => { autoplay.pause(); }) }); - this.splide.on('drag', function() { + this.splide.on('drag', () => { autoplay.pause(); }); } } listen() { - this.splide.on('move', function() { + this.splide.on('move', () => { this.splide.root.classList.add('is-moving') - }.bind(this)); + }); - this.splide.on('moved', function() { + this.splide.on('moved', () => { this.splide.root.classList.remove('is-moving') - }.bind(this)); + }); } } diff --git a/assets/sass/_theme/blocks/testimonials.sass b/assets/sass/_theme/blocks/testimonials.sass index d8463ae0..8f918805 100644 --- a/assets/sass/_theme/blocks/testimonials.sass +++ b/assets/sass/_theme/blocks/testimonials.sass @@ -57,6 +57,10 @@ width: 42px &::before color: $color-accent + &:not(.is-active) + + .splide__pagination + .is-active i + width: 100% !important .splide__play &::before -- GitLab