1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-17 19:06:40 +02:00

Enable unicorn/no-array-for-each rule

This commit is contained in:
XhmikosR
2021-07-30 09:28:51 +03:00
parent 2b4d0d166b
commit 666fe596bf
23 changed files with 132 additions and 117 deletions

View File

@@ -151,10 +151,10 @@ class Dropdown extends BaseComponent {
// empty mouseover listeners to the body's immediate children;
// 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 &&
!parent.closest(SELECTOR_NAVBAR_NAV)) {
[].concat(...document.body.children)
.forEach(elem => EventHandler.on(elem, 'mouseover', noop))
if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) {
for (const elem of [].concat(...document.body.children)) {
EventHandler.on(elem, 'mouseover', noop)
}
}
this._element.focus()
@@ -203,8 +203,9 @@ class Dropdown extends BaseComponent {
// If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
[].concat(...document.body.children)
.forEach(elem => EventHandler.off(elem, 'mouseover', noop))
for (const elem of [].concat(...document.body.children)) {
EventHandler.off(elem, 'mouseover', noop)
}
}
if (this._popper) {