mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-07 22:26:57 +02:00
Carousel: move logic of dataApiClickHandler
This commit is contained in:
@@ -464,8 +464,13 @@ class Carousel extends BaseComponent {
|
|||||||
Carousel.carouselInterface(this, config)
|
Carousel.carouselInterface(this, config)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static dataApiClickHandler(event) {
|
/**
|
||||||
|
* Data API implementation
|
||||||
|
*/
|
||||||
|
|
||||||
|
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, function (event) {
|
||||||
const target = getElementFromSelector(this)
|
const target = getElementFromSelector(this)
|
||||||
|
|
||||||
if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
|
if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
|
||||||
@@ -488,14 +493,7 @@ class Carousel extends BaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
carousel.prev()
|
carousel.prev()
|
||||||
}
|
})
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Data API implementation
|
|
||||||
*/
|
|
||||||
|
|
||||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler)
|
|
||||||
|
|
||||||
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
||||||
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)
|
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)
|
||||||
|
Reference in New Issue
Block a user