1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-07 14:16:47 +02:00

Carousel: simplify carousel items selection

We already know that carousel's parent is the carousel element, so we can use it explicitly
This commit is contained in:
GeoSot
2021-09-10 11:57:58 +03:00
committed by XhmikosR
parent eb8d5b43ce
commit c644f09d88

View File

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