]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Carousel: simplify carousel items selection
authorGeoSot <geo.sotis@gmail.com>
Fri, 10 Sep 2021 08:57:58 +0000 (11:57 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Tue, 1 Mar 2022 14:56:33 +0000 (16:56 +0200)
We already know that carousel's parent is the carousel element, so we can use it explicitly

js/src/carousel.js

index 4262d60dfda952920bb3728ada78b2a46831b23c..ea258527da51cbf6e29043158da3a4c215c4415d 100644 (file)
@@ -267,9 +267,7 @@ class Carousel extends BaseComponent {
   }
 
   _getItemIndex(element) {
-    this._items = element && element.parentNode ?
-      SelectorEngine.find(SELECTOR_ITEM, element.parentNode) :
-      []
+    this._items = SelectorEngine.find(SELECTOR_ITEM, this._element)
 
     return this._items.indexOf(element)
   }