diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-10-28 06:01:42 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-10-28 06:01:42 +0300 |
commit | fb65c6a1376d0075b19d29c1fe6e6d364e6b10c2 (patch) | |
tree | 31df6ac63542cfdf565a16f4dcf88179e6876a3f /assets/javascripts/bootstrap/popover.js | |
parent | 3d33a2266188389654ed6bbd418a19a3ad32fa70 (diff) |
rake convert
Diffstat (limited to 'assets/javascripts/bootstrap/popover.js')
-rw-r--r-- | assets/javascripts/bootstrap/popover.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/assets/javascripts/bootstrap/popover.js b/assets/javascripts/bootstrap/popover.js index 87b8d12..c69be71 100644 --- a/assets/javascripts/bootstrap/popover.js +++ b/assets/javascripts/bootstrap/popover.js @@ -86,12 +86,18 @@ function Plugin(option) { return this.each(function () { - var $this = $(this) - var data = $this.data('bs.popover') - var options = typeof option == 'object' && option + var $this = $(this) + var data = $this.data('bs.popover') + var options = typeof option == 'object' && option + var selector = options && options.selector if (!data && option == 'destroy') return - if (!data) $this.data('bs.popover', (data = new Popover(this, options))) + if (selector) { + if (!data) $this.data('bs.popover', (data = {})) + if (!data[selector]) data[selector] = new Popover(this, options) + } else { + if (!data) $this.data('bs.popover', (data = new Popover(this, options))) + } if (typeof option == 'string') data[option]() }) } |