aboutsummaryrefslogtreecommitdiff
path: root/js/src/carousel.js
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2021-10-06 14:40:59 -0400
committerGitHub <[email protected]>2021-10-06 14:40:59 -0400
commit52cd86f8710f8049a744b5bcb9f4a7ce19114b6e (patch)
tree8956dbd6f94ae25d273d496e64840ed30b6d88a5 /js/src/carousel.js
parentd065706ce4b439b5c77d9a68e708212e91cc4f0b (diff)
parentc331a150cdc2834f08bcf458cdb1b104cc510b67 (diff)
downloadbootstrap-52cd86f8710f8049a744b5bcb9f4a7ce19114b6e.tar.xz
bootstrap-52cd86f8710f8049a744b5bcb9f4a7ce19114b6e.zip
Merge branch 'twbs:main' into main
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 86daa0795..3f49ded40 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.1.1): carousel.js
+ * Bootstrap (v5.1.2): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -304,9 +304,9 @@ class Carousel extends BaseComponent {
}
}
- SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {
+ for (const itemImg of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) {
EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault())
- })
+ }
if (this._pointerEvent) {
EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event))
@@ -366,10 +366,10 @@ class Carousel extends BaseComponent {
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement)
- for (let i = 0; i < indicators.length; i++) {
- if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
- indicators[i].classList.add(CLASS_NAME_ACTIVE)
- indicators[i].setAttribute('aria-current', 'true')
+ for (const indicator of indicators) {
+ if (Number.parseInt(indicator.getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
+ indicator.classList.add(CLASS_NAME_ACTIVE)
+ indicator.setAttribute('aria-current', 'true')
break
}
}
@@ -574,8 +574,8 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.da
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)
- for (let i = 0, len = carousels.length; i < len; i++) {
- Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]))
+ for (const carousel of carousels) {
+ Carousel.carouselInterface(carousel, Carousel.getInstance(carousel))
}
})