diff options
author | Mario <mario@mariovavti.com> | 2021-03-08 09:31:23 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-08 09:31:23 +0000 |
commit | 951e9c8c4f39dd8577834d5bc501c05d80722de9 (patch) | |
tree | 6a42c6a229c7b2b3e13bc5af77a733d054242695 /vendor/twbs/bootstrap/js/src/carousel.js | |
parent | f94b046333c57acde493ee5dc2511acc6baca701 (diff) | |
parent | 89415e17313578eb115c441480b6e0ddfa90afef (diff) | |
download | volse-hubzilla-5.4.tar.gz volse-hubzilla-5.4.tar.bz2 volse-hubzilla-5.4.zip |
Merge branch '5.4RC'5.4
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/carousel.js')
-rw-r--r-- | vendor/twbs/bootstrap/js/src/carousel.js | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/vendor/twbs/bootstrap/js/src/carousel.js b/vendor/twbs/bootstrap/js/src/carousel.js index 5f738fd92..b63d406bd 100644 --- a/vendor/twbs/bootstrap/js/src/carousel.js +++ b/vendor/twbs/bootstrap/js/src/carousel.js @@ -1,6 +1,6 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v4.5.3): carousel.js + * Bootstrap (v4.6.0): carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ @@ -15,7 +15,7 @@ import Util from './util' */ const NAME = 'carousel' -const VERSION = '4.5.3' +const VERSION = '4.6.0' const DATA_KEY = 'bs.carousel' const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' @@ -169,6 +169,8 @@ class Carousel { } if (this._config.interval && !this._isPaused) { + this._updateInterval() + this._interval = setInterval( (document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval @@ -401,6 +403,23 @@ class Carousel { } } + _updateInterval() { + const element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM) + + if (!element) { + return + } + + const elementInterval = parseInt(element.getAttribute('data-interval'), 10) + + if (elementInterval) { + this._config.defaultInterval = this._config.defaultInterval || this._config.interval + this._config.interval = elementInterval + } else { + this._config.interval = this._config.defaultInterval || this._config.interval + } + } + _slide(direction, element) { const activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM) const activeElementIndex = this._getItemIndex(activeElement) @@ -445,6 +464,7 @@ class Carousel { } this._setActiveIndicatorElement(nextElement) + this._activeElement = nextElement const slidEvent = $.Event(EVENT_SLID, { relatedTarget: nextElement, @@ -461,14 +481,6 @@ class Carousel { $(activeElement).addClass(directionalClassName) $(nextElement).addClass(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) $(activeElement) |