]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
enable the ability to destroy tooltips and popovers from elements. related to issue...
authorJon Stevens <latchkey@gmail.com>
Tue, 19 Jun 2012 02:25:54 +0000 (19:25 -0700)
committerJon Stevens <latchkey@gmail.com>
Tue, 19 Jun 2012 02:25:54 +0000 (19:25 -0700)
docs/templates/pages/javascript.mustache
js/bootstrap-popover.js
js/bootstrap-tooltip.js

index 0a3a7aa8089d6ebdbb41741e0cc3543d95ed786d..bad7208890d8cd22d88af0bd7b685b468293df70 100644 (file)
@@ -755,6 +755,9 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
   <h4>.tooltip('toggle')</h4>
   <p>{{_i}}Toggles an element's tooltip.{{/i}}</p>
   <pre class="prettyprint linenums">$('#element').tooltip('toggle')</pre>
+  <h4>.tooltip('destroy')</h4>
+  <p>{{_i}}Destroys an element's tooltip.{{/i}}</p>
+  <pre class="prettyprint linenums">$('#element').tooltip('destroy')</pre>
 </section>
 
 
@@ -821,7 +824,7 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
        <td>{{_i}}trigger{{/i}}</td>
        <td>{{_i}}string{{/i}}</td>
        <td>'hover'</td>
-       <td>{{_i}}how tooltip is triggered{{/i}} - hover | focus | manual</td>
+       <td>{{_i}}how popover is triggered{{/i}} - hover | focus | manual</td>
      </tr>
      <tr>
        <td>{{_i}}title{{/i}}</td>
@@ -867,6 +870,9 @@ $('a[data-toggle="tab"]').on('shown', function (e) {
   <h4>.popover('toggle')</h4>
   <p>{{_i}}Toggles an elements popover.{{/i}}</p>
   <pre class="prettyprint linenums">$('#element').popover('toggle')</pre>
+  <h4>.popover('popover')</h4>
+  <p>{{_i}}Destroys an element's popover.{{/i}}</p>
+  <pre class="prettyprint linenums">$('#element').popover('destroy')</pre>
 </section>
 
 
index c6c1f8b4732f3865b590f4bdf283228fc9c09bde..456b74bdd48672968d5686637a3d5a79ce7f48fd 100644 (file)
       return this.$tip
     }
 
+  , destroy: function () {
+      var $e = this.$element
+      $e.off()
+      $e.removeData('popover')
+    }
+
   })
 
 
index f5f9fad3f49e2d6f8f6f588d373db33bfb72b8b6..93525b8bd3315be8c8ebe4452f0bf9675549d9c5 100644 (file)
       this[this.tip().hasClass('in') ? 'hide' : 'show']()
     }
 
+  , destroy: function () {
+      var $e = this.$element
+      $e.off()
+      $e.removeData('tooltip')
+    }
+
   }