]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add initialization examples to tooltip and popover "Opt-in functionality" callouts
authorJayanth Koushik <jnkoushik@gmail.com>
Tue, 4 Nov 2014 16:50:34 +0000 (22:20 +0530)
committerHeinrich Fenkart <hnrch02@gmail.com>
Tue, 4 Nov 2014 19:00:08 +0000 (20:00 +0100)
Fixes #14950.
Closes #15015 by merging it.

docs/_includes/js/popovers.html
docs/_includes/js/tooltips.html

index 7739c685e01eb07861c0e67bd92d5ad20ba5c772..09b8f36ebde2c66bbbb71b403f08f7bb3a7a6db4 100644 (file)
   <div class="bs-callout bs-callout-danger">
     <h4>Opt-in functionality</h4>
     <p>For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning <strong>you must initialize them yourself</strong>.</p>
+    <p>One way to initialize all popovers on a page would be to select them by their <code>data-toggle</code> attribute:</p>
+{% highlight js %}
+$(function () {
+  $('[data-toggle="popover"]').popover()
+})
+{% endhighlight %}
   </div>
   <div class="bs-callout bs-callout-warning">
     <h4>Popovers in button groups and input groups require special setting</h4>
index 3ec076b70bfcd29630b237bb6d68911d728f098a..87893608b509909221a3d986fe36d6685f1611e8 100644 (file)
   <div class="bs-callout bs-callout-danger">
     <h4>Opt-in functionality</h4>
     <p>For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning <strong>you must initialize them yourself</strong>.</p>
+    <p>One way to initialize all tooltips on a page would be to select them by their <code>data-toggle</code> attribute:</p>
+{% highlight js %}
+$(function () {
+  $('[data-toggle="tooltip"]').tooltip()
+})
+{% endhighlight %}
+
   </div>
   <div class="bs-callout bs-callout-warning">
     <h4>Tooltips in button groups and input groups require special setting</h4>