diff options
author | Christopher Morrissey <morrissey@ingenious.org> | 2018-09-18 15:55:48 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2018-09-18 15:55:48 +0300 |
commit | ea0faadde5c222cdd8127332b62a6d565a055d80 (patch) | |
tree | 6292c56e10eb63ae2a8b42491aee6aedbd879504 /js/src/carousel.js | |
parent | e6049586413f663ae99ec660d6378306833e2223 (diff) |
feature(carousel): carousel-item interval (#26667)
adds the ability to assign data-interval to an individual carousel-item
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r-- | js/src/carousel.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index 2d7ab0d672..610319a6e0 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -385,6 +385,14 @@ const 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) |