aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Berger <[email protected]>2013-09-23 15:14:37 +0200
committerJochen Berger <[email protected]>2013-09-23 15:14:37 +0200
commitf350d1ba3df6f477203d721a213d4f9a753aa17d (patch)
tree30f0edd5daa3dd88f2c411a5cfbdd2b4186f4266
parent8a181a138873bbec47c18d70055b0f2e40c810ce (diff)
downloadbootstrap-f350d1ba3df6f477203d721a213d4f9a753aa17d.tar.xz
bootstrap-f350d1ba3df6f477203d721a213d4f9a753aa17d.zip
don't create new Tooltip/Popover objects just to destroy them immediately
-rw-r--r--js/popover.js1
-rw-r--r--js/tooltip.js1
2 files changed, 2 insertions, 0 deletions
diff --git a/js/popover.js b/js/popover.js
index ecd37ac23..e313242e8 100644
--- a/js/popover.js
+++ b/js/popover.js
@@ -96,6 +96,7 @@
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.popover')
+ if (!data && option === 'destroy') return
var options = typeof option == 'object' && option
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
diff --git a/js/tooltip.js b/js/tooltip.js
index 89802287a..65006e24f 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -365,6 +365,7 @@
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.tooltip')
+ if (!data && option === 'destroy') return
var options = typeof option == 'object' && option
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))