diff options
author | Johann-S <johann.servoire@gmail.com> | 2018-07-25 12:29:16 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2019-02-20 23:05:45 +0300 |
commit | c44db783bf17c907dd46f53fdaa917ec74ffbded (patch) | |
tree | 69a380068b58961b01e5cd465e118dbda4d376dd /js/src/carousel.js | |
parent | cf821e1d4d1d67f6b4ce9651ae64c72a502c40ba (diff) |
chore(update): bump to 4.1.3
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r-- | js/src/carousel.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index 32a039c49d..9ff7c09e72 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 |