mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-26 23:54:23 +01:00
Carousel: refactor dataApiKeyHandler to avoid use of carouselInterface
This commit is contained in:
parent
7d9423d21c
commit
631cec4f70
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user