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:
committed by
Heinrich Fenkart
parent
0521913a99
commit
1b3237629a
@@ -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]()
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user