don't create new Tooltip/Popover objects just to destroy them immediately

This commit is contained in:
Jochen Berger 2013-09-23 15:14:37 +02:00
parent 8a181a1388
commit f350d1ba3d
2 changed files with 2 additions and 0 deletions

View File

@ -96,6 +96,7 @@
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
var data = $this.data('bs.popover') var data = $this.data('bs.popover')
if (!data && option === 'destroy') return
var options = typeof option == 'object' && option var options = typeof option == 'object' && option
if (!data) $this.data('bs.popover', (data = new Popover(this, options))) if (!data) $this.data('bs.popover', (data = new Popover(this, options)))

View File

@ -365,6 +365,7 @@
return this.each(function () { return this.each(function () {
var $this = $(this) var $this = $(this)
var data = $this.data('bs.tooltip') var data = $this.data('bs.tooltip')
if (!data && option === 'destroy') return
var options = typeof option == 'object' && option var options = typeof option == 'object' && option
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))