Commit 6baf266c authored by Jacob's avatar Jacob
Browse files

Merge pull request #10761 from jochenberger/dont-create-tooltip-for-destroy

don't create new Tooltip/Popover objects just to destroy them immediately
parents 39091b07 f350d1ba
Showing with 2 additions and 0 deletions
+2 -0
...@@ -85,6 +85,7 @@ ...@@ -85,6 +85,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)))
......
...@@ -376,6 +376,7 @@ ...@@ -376,6 +376,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)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment