aboutsummaryrefslogtreecommitdiff
path: root/js/src/carousel.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 32a039c49..9ff7c09e7 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -178,7 +178,7 @@ class Carousel {
this._interval = null
}
- if (this._config.interval && !this._isPaused) {
+ if (this._config && this._config.interval && !this._isPaused) {
this._interval = setInterval(
(document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
this._config.interval
@@ -298,7 +298,7 @@ class Carousel {
}
const end = (event) => {
- if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
+ if (this._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
this.touchDeltaX = event.clientX - this.touchStartX
}
@@ -464,6 +464,14 @@ class Carousel {
activeElement.classList.add(directionalClassName)
nextElement.classList.add(directionalClassName)
+ const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)
+ if (nextElementInterval) {
+ this._config.defaultInterval = this._config.defaultInterval || this._config.interval
+ this._config.interval = nextElementInterval
+ } else {
+ this._config.interval = this._config.defaultInterval || this._config.interval
+ }
+
const transitionDuration = Util.getTransitionDurationFromElement(activeElement)
EventHandler