From f350d1ba3df6f477203d721a213d4f9a753aa17d Mon Sep 17 00:00:00 2001 From: Jochen Berger Date: Mon, 23 Sep 2013 15:14:37 +0200 Subject: [PATCH] don't create new Tooltip/Popover objects just to destroy them immediately --- js/popover.js | 1 + js/tooltip.js | 1 + 2 files changed, 2 insertions(+) diff --git a/js/popover.js b/js/popover.js index ecd37ac233..e313242e82 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 89802287a3..65006e24f2 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)))