Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorДилян Палаузов <git-dpa@aegee.org>2022-01-27 11:43:27 +0300
committerMark Otto <otto@github.com>2022-02-25 20:01:49 +0300
commite4b62a920a5ed9c48c46865f987702fa67369ae0 (patch)
tree51fb2b23c11c067f78763f8369a2eec0121f5f47 /js/src
parent28d9aaf6708b4b84e7e70a62b78d8b22a51d990d (diff)
src/tooltip.js Optimization
Util.findShadowRoot() returns either null or an object. It cannot return falsy, which allows this optimization.
Diffstat (limited to 'js/src')
-rw-r--r--js/src/tooltip.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index 5cf56ce6e3..db626048f6 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -199,9 +199,7 @@ class Tooltip extends BaseComponent {
const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW))
const shadowRoot = findShadowRoot(this._element)
- const isInTheDom = shadowRoot === null ?
- this._element.ownerDocument.documentElement.contains(this._element) :
- shadowRoot.contains(this._element)
+ const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element)
if (showEvent.defaultPrevented || !isInTheDom) {
return