1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 05:19:15 +02:00

JS: minor refactoring (#35183)

* add missing comments
* shorten block comments
* reorder constants
* reorder public/private methods
* sort exports alphabetically in util/index.js
* fix a couple of typos
This commit is contained in:
XhmikosR
2021-10-13 15:19:28 +03:00
committed by GitHub
parent db44392bda
commit e8f702666f
21 changed files with 261 additions and 384 deletions

View File

@@ -5,14 +5,12 @@
* --------------------------------------------------------------------------
*/
/**
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
import { isDisabled, isVisible } from '../util/index'
/**
* Constants
*/
const NODE_TEXT = 3
const SelectorEngine = {
@@ -25,13 +23,11 @@ const SelectorEngine = {
},
children(element, selector) {
return [].concat(...element.children)
.filter(child => child.matches(selector))
return [].concat(...element.children).filter(child => child.matches(selector))
},
parents(element, selector) {
const parents = []
let ancestor = element.parentNode
while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {