diff options
| author | XhmikosR <[email protected]> | 2021-10-13 15:19:28 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-13 15:19:28 +0300 |
| commit | e8f702666f285a3e69866ed1f8d29fa6eaaaeabb (patch) | |
| tree | 944b2dc894f49f8278d41d096e4388e9ac83157b /js/src/dom/selector-engine.js | |
| parent | db44392bda22f3d5319d2880c992f76d27d2a60c (diff) | |
| download | bootstrap-e8f702666f285a3e69866ed1f8d29fa6eaaaeabb.tar.xz bootstrap-e8f702666f285a3e69866ed1f8d29fa6eaaaeabb.zip | |
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
Diffstat (limited to 'js/src/dom/selector-engine.js')
| -rw-r--r-- | js/src/dom/selector-engine.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/js/src/dom/selector-engine.js b/js/src/dom/selector-engine.js index 54f270f4c..af27dc379 100644 --- a/js/src/dom/selector-engine.js +++ b/js/src/dom/selector-engine.js @@ -5,14 +5,12 @@ * -------------------------------------------------------------------------- */ +import { isDisabled, isVisible } from '../util/index' + /** - * ------------------------------------------------------------------------ * Constants - * ------------------------------------------------------------------------ */ -import { isDisabled, isVisible } from '../util/index' - 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) { |
