1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

Allow multiple delegated tooltip selectors on a node

Fixes #14167.
Closes #14189 by merging it.
This commit is contained in:
Andrew S. Brown
2014-07-18 11:37:11 -07:00
committed by Heinrich Fenkart
parent 0521913a99
commit 1b3237629a
4 changed files with 95 additions and 8 deletions

View File

@@ -442,12 +442,18 @@
function Plugin(option) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
var selector = options && options.selector
if (!data && option == 'destroy') return
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
if (selector) {
if (!data) $this.data('bs.tooltip', (data = {}))
if (!data[selector]) data[selector] = new Tooltip(this, options)
} else {
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
}
if (typeof option == 'string') data[option]()
})
}