diff options
| author | Дилян Палаузов <[email protected]> | 2022-01-27 10:43:27 +0200 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2022-02-25 09:01:49 -0800 |
| commit | e4b62a920a5ed9c48c46865f987702fa67369ae0 (patch) | |
| tree | 51fb2b23c11c067f78763f8369a2eec0121f5f47 /js/src | |
| parent | 28d9aaf6708b4b84e7e70a62b78d8b22a51d990d (diff) | |
| download | bootstrap-e4b62a920a5ed9c48c46865f987702fa67369ae0.tar.xz bootstrap-e4b62a920a5ed9c48c46865f987702fa67369ae0.zip | |
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.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js index 5cf56ce6e..db626048f 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 |
