Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoSot <geo.sotis@gmail.com>2021-09-10 03:33:14 +0300
committerXhmikosR <xhmikosr@gmail.com>2022-03-01 17:56:33 +0300
commit631cec4f70fa74b066c9d949aa5b8bf8cf06b46d (patch)
tree2c574d2e7713593014ec6d9fac12d7ef9188341b /js/src/carousel.js
parent7d9423d21c2b431b4413e6ac9d0c985ec74eb2c9 (diff)
Carousel: refactor dataApiKeyHandler to avoid use of `carouselInterface`
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 7b22e9cbfe..a5fe2597b8 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -472,22 +472,22 @@ class Carousel extends BaseComponent {
return
}
- const config = {
- ...Manipulator.getDataAttributes(this)
- }
+ event.preventDefault()
+
+ const carousel = Carousel.getOrCreateInstance(target)
const slideIndex = this.getAttribute('data-bs-slide-to')
if (slideIndex) {
- config.interval = false
+ carousel.to(slideIndex)
+ return
}
- Carousel.carouselInterface(target, config)
-
- if (slideIndex) {
- Carousel.getInstance(target).to(slideIndex)
+ if (Manipulator.getDataAttribute(this, 'slide') === 'next') {
+ carousel.next()
+ return
}
- event.preventDefault()
+ carousel.prev()
}
}