1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 13:29:06 +02:00

Enable unicorn/no-for-loop rule

This commit is contained in:
XhmikosR
2021-08-10 18:07:39 +03:00
parent 9f1579aa04
commit 2b4d0d166b
6 changed files with 15 additions and 20 deletions

View File

@@ -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))
}
})