diff options
author | Mario <mario@mariovavti.com> | 2022-08-19 13:15:48 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-08-19 13:15:48 +0000 |
commit | 185ddf1eaf82e08586be6c7689507ee924d9dd47 (patch) | |
tree | 218ff6da6fb1511a1b2823729607c7c4b13e30e9 /vendor/twbs/bootstrap/js/src/dom/selector-engine.js | |
parent | 7dee47183d05b6e1f7d5c5588e2df9993fb294dd (diff) | |
download | volse-hubzilla-185ddf1eaf82e08586be6c7689507ee924d9dd47.tar.gz volse-hubzilla-185ddf1eaf82e08586be6c7689507ee924d9dd47.tar.bz2 volse-hubzilla-185ddf1eaf82e08586be6c7689507ee924d9dd47.zip |
update to bootstrap 5.2 and fixes
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/dom/selector-engine.js')
-rw-r--r-- | vendor/twbs/bootstrap/js/src/dom/selector-engine.js | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/vendor/twbs/bootstrap/js/src/dom/selector-engine.js b/vendor/twbs/bootstrap/js/src/dom/selector-engine.js index 54f270f4c..d2af46ff6 100644 --- a/vendor/twbs/bootstrap/js/src/dom/selector-engine.js +++ b/vendor/twbs/bootstrap/js/src/dom/selector-engine.js @@ -1,20 +1,16 @@ /** * -------------------------------------------------------------------------- - * Bootstrap (v5.1.3): dom/selector-engine.js + * Bootstrap (v5.2.0): dom/selector-engine.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ +import { isDisabled, isVisible } from '../util/index' + /** - * ------------------------------------------------------------------------ * Constants - * ------------------------------------------------------------------------ */ -import { isDisabled, isVisible } from '../util/index' - -const NODE_TEXT = 3 - const SelectorEngine = { find(selector, element = document.documentElement) { return [].concat(...Element.prototype.querySelectorAll.call(element, selector)) @@ -25,21 +21,16 @@ 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.closest(selector) - let ancestor = element.parentNode - - while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { - if (ancestor.matches(selector)) { - parents.push(ancestor) - } - - ancestor = ancestor.parentNode + while (ancestor) { + parents.push(ancestor) + ancestor = ancestor.parentNode.closest(selector) } return parents @@ -58,7 +49,7 @@ const SelectorEngine = { return [] }, - + // TODO: this is now unused; remove later along with prev() next(element, selector) { let next = element.nextElementSibling @@ -83,7 +74,7 @@ const SelectorEngine = { 'details', '[tabindex]', '[contenteditable="true"]' - ].map(selector => `${selector}:not([tabindex^="-"])`).join(', ') + ].map(selector => `${selector}:not([tabindex^="-"])`).join(',') return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)) } |