diff options
author | Hilmar R <u02@u29lx193> | 2021-02-28 21:06:16 +0100 |
---|---|---|
committer | Hilmar R <u02@u29lx193> | 2021-03-01 18:48:11 +0100 |
commit | c26dede97f626b52b7bf8962ed55d1dbda86abe8 (patch) | |
tree | 3c8c9bc97aa09f7ce9afe9bf467cf87bbf2c7d0b /vendor/twbs/bootstrap/js/src/carousel.js | |
parent | ea3390d626f85b7293a750958bfd1b5460958365 (diff) | |
download | volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.gz volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.bz2 volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.zip |
get dev
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) |