mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-09 15:16:51 +02:00
dist
This commit is contained in:
19
js/dist/tooltip.js
vendored
19
js/dist/tooltip.js
vendored
@@ -259,7 +259,8 @@
|
||||
|
||||
if (this.isWithContent() && this._isEnabled) {
|
||||
$(this.element).trigger(showEvent);
|
||||
var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
|
||||
var shadowRoot = Util.findShadowRoot(this.element);
|
||||
var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
|
||||
|
||||
if (showEvent.isDefaultPrevented() || !isInTheDom) {
|
||||
return;
|
||||
@@ -280,7 +281,9 @@
|
||||
var attachment = this._getAttachment(placement);
|
||||
|
||||
this.addAttachmentClass(attachment);
|
||||
var container = this.config.container === false ? document.body : $(document).find(this.config.container);
|
||||
|
||||
var container = this._getContainer();
|
||||
|
||||
$(tip).data(this.constructor.DATA_KEY, this);
|
||||
|
||||
if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
|
||||
@@ -452,6 +455,18 @@
|
||||
}; // Private
|
||||
|
||||
|
||||
_proto._getContainer = function _getContainer() {
|
||||
if (this.config.container === false) {
|
||||
return document.body;
|
||||
}
|
||||
|
||||
if (Util.isElement(this.config.container)) {
|
||||
return $(this.config.container);
|
||||
}
|
||||
|
||||
return $(document).find(this.config.container);
|
||||
};
|
||||
|
||||
_proto._getAttachment = function _getAttachment(placement) {
|
||||
return AttachmentMap[placement.toUpperCase()];
|
||||
};
|
||||
|
Reference in New Issue
Block a user