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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const config = {
|
event.preventDefault()
|
||||||
...Manipulator.getDataAttributes(this)
|
|
||||||
}
|
const carousel = Carousel.getOrCreateInstance(target)
|
||||||
const slideIndex = this.getAttribute('data-bs-slide-to')
|
const slideIndex = this.getAttribute('data-bs-slide-to')
|
||||||
|
|
||||||
if (slideIndex) {
|
if (slideIndex) {
|
||||||
config.interval = false
|
carousel.to(slideIndex)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Carousel.carouselInterface(target, config)
|
if (Manipulator.getDataAttribute(this, 'slide') === 'next') {
|
||||||
|
carousel.next()
|
||||||
if (slideIndex) {
|
return
|
||||||
Carousel.getInstance(target).to(slideIndex)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault()
|
carousel.prev()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user