mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
src/tooltip.js Optimization
Util.findShadowRoot() returns either null or an object. It cannot return falsy, which allows this optimization.
This commit is contained in:
parent
28d9aaf670
commit
e4b62a920a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user