2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-17 19:21:23 +03: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
+10 -4
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]()
})
}