1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-20 04:11:39 +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

@@ -333,8 +333,8 @@ const Dropdown = (($) => {
return
}
const toggles = $.makeArray($(Selector.DATA_TOGGLE))
for (let i = 0; i < toggles.length; i++) {
const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
for (let i = 0, len = toggles.length; i < len; i++) {
const parent = Dropdown._getParentFromElement(toggles[i])
const context = $(toggles[i]).data(DATA_KEY)
const relatedTarget = {