diff --git a/assets/js/vendors/carousel.js b/assets/js/vendors/carousel.js index 790cfaf8513c97b451e905d07baa4f1c20c0f62d..f2ec6a3c9e21e916ede5df3ce4d8d4ab309fc533 100644 --- a/assets/js/vendors/carousel.js +++ b/assets/js/vendors/carousel.js @@ -22,7 +22,8 @@ class Carousel { init () { var splide = new Splide(this.element).mount(), toggleButton = splide.root.querySelector('.splide__autoplay'), - stepButtons = splide.root.querySelectorAll('.splide__pagination button'); + stepButtons = splide.root.querySelectorAll('.splide__pagination button'), + autoplay = splide.Components.Autoplay; if (toggleButton) { stepButtons.forEach((stepButton) => { @@ -41,6 +42,13 @@ class Carousel { splide.on('autoplay:pause', function () { toggleButton.classList.remove('is-active'); }); + + // TODO: WIP + // this.element.addEventListener('click', function () { + // if (!autoplay.isPaused()) { + // autoplay.pause(); + // } + // }); } } }