]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Carousel: change argument to `_setActiveIndicatorElement`, from element to index
authorGeoSot <geo.sotis@gmail.com>
Fri, 10 Sep 2021 09:00:28 +0000 (12:00 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Sat, 19 Feb 2022 12:52:36 +0000 (14:52 +0200)
js/src/carousel.js

index b8d921e422734e6793d74b66ed019b8de45433d5..e3c8360482e8347a64e6152f655ce73d81a43d53 100644 (file)
@@ -291,7 +291,7 @@ class Carousel extends BaseComponent {
     })
   }
 
-  _setActiveIndicatorElement(element) {
+  _setActiveIndicatorElement(index) {
     if (!this._indicatorsElement) {
       return
     }
@@ -301,7 +301,7 @@ class Carousel extends BaseComponent {
     activeIndicator.classList.remove(CLASS_NAME_ACTIVE)
     activeIndicator.removeAttribute('aria-current')
 
-    const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${this._getItemIndex(element)}"]`, this._indicatorsElement)
+    const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement)
 
     if (newActiveIndicator) {
       newActiveIndicator.classList.add(CLASS_NAME_ACTIVE)
@@ -360,7 +360,7 @@ class Carousel extends BaseComponent {
       this.pause()
     }
 
-    this._setActiveIndicatorElement(nextElement)
+    this._setActiveIndicatorElement(nextElementIndex)
     this._activeElement = nextElement
 
     nextElement.classList.add(orderClassName)