mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
Carousel: remove one more call to ActiveIndex
This commit is contained in:
parent
d52f6c9de1
commit
642d756eea
@ -279,9 +279,8 @@ class Carousel extends BaseComponent {
|
||||
return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap)
|
||||
}
|
||||
|
||||
_triggerSlideEvent(relatedTarget, eventDirectionName) {
|
||||
_triggerSlideEvent(relatedTarget, fromIndex, eventDirectionName) {
|
||||
const targetIndex = this._getItemIndex(relatedTarget)
|
||||
const fromIndex = this._getItemIndex(this._getActive())
|
||||
|
||||
return EventHandler.trigger(this._element, EVENT_SLIDE, {
|
||||
relatedTarget,
|
||||
@ -344,7 +343,7 @@ class Carousel extends BaseComponent {
|
||||
return
|
||||
}
|
||||
|
||||
const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)
|
||||
const slideEvent = this._triggerSlideEvent(nextElement, activeElementIndex, eventDirectionName)
|
||||
if (slideEvent.defaultPrevented) {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user