mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-03-29 02:30:23 +00:00
Carousel: refactor dataApiKeyHandler to avoid use of carouselInterface
This commit is contained in:
parent
7d9423d21c
commit
631cec4f70
1 changed files with 9 additions and 9 deletions
|
|
@ -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…
Reference in a new issue