mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03: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:
+1
-3
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user