1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-13 00:54:04 +02:00

Merge branch 'container-tooltip-option' into v4-dev

This commit is contained in:
Mark Otto
2016-11-26 17:02:40 -08:00
2 changed files with 8 additions and 4 deletions

View File

@@ -46,7 +46,8 @@ const Tooltip = (($) => {
selector : false,
placement : 'top',
offset : '0 0',
constraints : []
constraints : [],
container : false
}
const DefaultType = {
@@ -59,7 +60,8 @@ const Tooltip = (($) => {
selector : '(string|boolean)',
placement : '(string|function)',
offset : 'string',
constraints : 'array'
constraints : 'array',
container : '(string|element|boolean)'
}
const AttachmentMap = {
@@ -274,9 +276,11 @@ const Tooltip = (($) => {
const attachment = this._getAttachment(placement)
const container = this.config.container === false ? document.body : $(this.config.container)
$(tip)
.data(this.constructor.DATA_KEY, this)
.appendTo(document.body)
.appendTo(container)
$(this.element).trigger(this.constructor.Event.INSERTED)