mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-03-24 16:30:23 +00: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:
parent
eb8d5b43ce
commit
c644f09d88
1 changed files with 1 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue