1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-27 05:49:07 +02:00

refactor(plugins): improve how we query elements

This commit is contained in:
Johann-S
2018-04-30 16:37:45 +02:00
parent 62cc0fda50
commit b1eb3fccfa
6 changed files with 34 additions and 26 deletions

View File

@@ -492,10 +492,11 @@ const Carousel = (($) => {
.on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)
$(window).on(Event.LOAD_DATA_API, () => {
$(Selector.DATA_RIDE).each(function () {
const $carousel = $(this)
const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))
for (let i = 0, len = carousels.length; i < len; i++) {
const $carousel = $(carousels[i])
Carousel._jQueryInterface.call($carousel, $carousel.data())
})
}
})
/**