aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-09-10 11:57:58 +0300
committerXhmikosR <[email protected]>2022-03-01 16:56:33 +0200
commitc644f09d88a93445b415faa796f1d246ca34e2e7 (patch)
tree1206c0a56c3f8746f99c39cef0621a4f1c4d1e69 /js/src
parenteb8d5b43cedc76d88331f4d2f6ed3bca10e573ff (diff)
downloadbootstrap-c644f09d88a93445b415faa796f1d246ca34e2e7.tar.xz
bootstrap-c644f09d88a93445b415faa796f1d246ca34e2e7.zip
Carousel: simplify carousel items selection
We already know that carousel's parent is the carousel element, so we can use it explicitly
Diffstat (limited to 'js/src')
-rw-r--r--js/src/carousel.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 4262d60df..ea258527d 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -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)
}