]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
don't create new Tooltip/Popover objects just to destroy them immediately 10761/head
authorJochen Berger <fooberger@gmail.com>
Mon, 23 Sep 2013 13:14:37 +0000 (15:14 +0200)
committerJochen Berger <fooberger@gmail.com>
Mon, 23 Sep 2013 13:14:37 +0000 (15:14 +0200)
js/popover.js
js/tooltip.js

index ecd37ac233ad509eb15f6a1662d331fe613b0104..e313242e825b277eb2f6ae3ea468f80ac5ab3d21 100644 (file)
@@ -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)))
index 89802287a32cece7dcfd0d2543f652d3b7918d55..65006e24f2b6607f238e2900fce334a0a3fc24c0 100644 (file)
     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)))