diff options
author | Andrew S. Brown <andrew@dontfidget.com> | 2014-07-18 22:37:11 +0400 |
---|---|---|
committer | Heinrich Fenkart <hnrch02@gmail.com> | 2014-10-26 05:51:55 +0300 |
commit | 1b3237629a316af41945e20837cf3a332798b264 (patch) | |
tree | 3e1ea9aacbfe28dd80863cd75be73e0c170519c6 /js/tooltip.js | |
parent | 0521913a99b1e6c4927b0d0f7bae746b14463a77 (diff) |
Allow multiple delegated tooltip selectors on a node
Fixes #14167.
Closes #14189 by merging it.
Diffstat (limited to 'js/tooltip.js')
-rw-r--r-- | js/tooltip.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/js/tooltip.js b/js/tooltip.js index 944586a2d0..08d22971fd 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -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]() }) } |