aboutsummaryrefslogtreecommitdiff
path: root/js/src/dropdown.js
diff options
context:
space:
mode:
authorJohann-S <[email protected]>2020-03-25 15:35:02 +0100
committerGitHub <[email protected]>2020-03-25 16:35:02 +0200
commit26d86fce2a10f5c9e295b0acf5e6381ff21368b4 (patch)
tree63ed06cb159ad7b625aa6b4c8d7460a1a269db43 /js/src/dropdown.js
parent98c45986962f8ab16bc630722e96dbfb048079b3 (diff)
downloadbootstrap-26d86fce2a10f5c9e295b0acf5e6381ff21368b4.tar.xz
bootstrap-26d86fce2a10f5c9e295b0acf5e6381ff21368b4.zip
fix: remove make array util function (#30430)
Diffstat (limited to 'js/src/dropdown.js')
-rw-r--r--js/src/dropdown.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index b8f8c22b8..aab1d6bd2 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -10,7 +10,6 @@ import {
getElementFromSelector,
isElement,
isVisible,
- makeArray,
noop,
typeCheckConfig
} from './util/index'
@@ -190,8 +189,8 @@ class Dropdown {
// only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement &&
- !makeArray(SelectorEngine.closest(parent, SELECTOR_NAVBAR_NAV)).length) {
- makeArray(document.body.children)
+ !SelectorEngine.closest(parent, SELECTOR_NAVBAR_NAV)) {
+ [].concat(...document.body.children)
.forEach(elem => EventHandler.on(elem, 'mouseover', null, noop()))
}
@@ -378,7 +377,8 @@ class Dropdown {
return
}
- const toggles = makeArray(SelectorEngine.find(SELECTOR_DATA_TOGGLE))
+ const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE)
+
for (let i = 0, len = toggles.length; i < len; i++) {
const parent = Dropdown.getParentFromElement(toggles[i])
const context = Data.getData(toggles[i], DATA_KEY)
@@ -414,7 +414,7 @@ class Dropdown {
// If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
- makeArray(document.body.children)
+ [].concat(...document.body.children)
.forEach(elem => EventHandler.off(elem, 'mouseover', null, noop()))
}
@@ -472,7 +472,7 @@ class Dropdown {
return
}
- const items = makeArray(SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, parent))
+ const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, parent)
.filter(isVisible)
if (!items.length) {