mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
Carousel: refactor dataApiKeyHandler to avoid use of carouselInterface
This commit is contained in:
+9
-9
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user