From e8f702666f285a3e69866ed1f8d29fa6eaaaeabb Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 13 Oct 2021 15:19:28 +0300 Subject: 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 --- js/src/dom/selector-engine.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'js/src/dom/selector-engine.js') 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) { -- cgit v1.2.3