fix regression about using element for tooltip container option
This commit is contained in:
parent
1a171b80ab
commit
37f74c7070
3 changed files with 67 additions and 4 deletions
|
|
@ -272,8 +272,7 @@ class Tooltip {
|
|||
const attachment = this._getAttachment(placement)
|
||||
this.addAttachmentClass(attachment)
|
||||
|
||||
const container = this.config.container === false ? document.body : $(document).find(this.config.container)
|
||||
|
||||
const container = this._getContainer()
|
||||
$(tip).data(this.constructor.DATA_KEY, this)
|
||||
|
||||
if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
|
||||
|
|
@ -450,6 +449,18 @@ class Tooltip {
|
|||
|
||||
// Private
|
||||
|
||||
_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)
|
||||
}
|
||||
|
||||
_getAttachment(placement) {
|
||||
return AttachmentMap[placement.toUpperCase()]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue