aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-07-08 01:25:22 +0300
committerGeoSot <[email protected]>2021-09-10 01:39:01 +0300
commitce68b706d0829eaf2d9a67ae102b8a05b583a9fc (patch)
treecd4a78011e043ed9001d68c177272d443cd34eaf
parent1df098361cac04217d6a464c80e890c4335ecb5c (diff)
downloadbootstrap-ce68b706d0829eaf2d9a67ae102b8a05b583a9fc.tar.xz
bootstrap-ce68b706d0829eaf2d9a67ae102b8a05b583a9fc.zip
Use Manipulator to get element Data
-rw-r--r--js/src/carousel.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 981ce561b..73ca4a839 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -367,7 +367,7 @@ class Carousel extends BaseComponent {
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement)
for (let i = 0; i < indicators.length; i++) {
- if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
+ if (Number.parseInt(Manipulator.getDataAttribute(indicators[i], 'slide-to'), 10) === this._getItemIndex(element)) {
indicators[i].classList.add(CLASS_NAME_ACTIVE)
indicators[i].setAttribute('aria-current', 'true')
break
@@ -383,7 +383,7 @@ class Carousel extends BaseComponent {
return
}
- const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10)
+ const elementInterval = Number.parseInt(Manipulator.getDataAttribute(element, 'interval'), 10)
if (elementInterval) {
this._config.defaultInterval = this._config.defaultInterval || this._config.interval
@@ -547,7 +547,7 @@ class Carousel extends BaseComponent {
...Manipulator.getDataAttributes(target),
...Manipulator.getDataAttributes(this)
}
- const slideIndex = this.getAttribute('data-bs-slide-to')
+ const slideIndex = Manipulator.getDataAttribute(this, 'slide-to')
if (slideIndex) {
config.interval = false