aboutsummaryrefslogtreecommitdiff
path: root/docs/javascript.html
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-03-07 01:31:01 -0800
committerMark Otto <[email protected]>2014-03-07 01:31:01 -0800
commit864a18f95e29f7573c658df5869ccaa5aba4c46f (patch)
treee7f75d3d3e2e9c2ff161b2d8a46abaa483a6bc1c /docs/javascript.html
parent1f148427de6d35a06e225deeee0b162b11955232 (diff)
parent0b8d27a125dfaace415818d2bcb7c018a0ec0bd0 (diff)
downloadbootstrap-864a18f95e29f7573c658df5869ccaa5aba4c46f.tar.xz
bootstrap-864a18f95e29f7573c658df5869ccaa5aba4c46f.zip
Merge pull request #12688 from twbs/document_popover_focus
Document popover focus
Diffstat (limited to 'docs/javascript.html')
-rw-r--r--docs/javascript.html21
1 files changed, 20 insertions, 1 deletions
diff --git a/docs/javascript.html b/docs/javascript.html
index bf5944fcb..48e07485a 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -1101,6 +1101,8 @@ $('#myTooltip').on('hidden.bs.tooltip', function () {
{% endhighlight %}
</div>
+
+
<!-- Popovers
================================================== -->
<div class="bs-docs-section">
@@ -1167,8 +1169,11 @@ $('#myTooltip').on('hidden.bs.tooltip', function () {
<h3>Live demo</h3>
<div class="bs-example" style="padding-bottom: 24px;">
- <a href="#" class="btn btn-lg btn-danger" data-toggle="popover" title="A Title" data-content="And here's some amazing content. It's very engaging. right?" role="button">Click to toggle popover</a>
+ <button type="button" class="btn btn-lg btn-danger bs-docs-popover" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
</div>
+{% highlight html %}
+<button type="button" class="btn btn-lg btn-danger" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>
+{% endhighlight %}
<h4>Four directions</h4>
<div class="bs-example tooltip-demo">
@@ -1206,6 +1211,20 @@ sagittis lacus vel augue laoreet rutrum faucibus.">
</button>
{% endhighlight %}
+ <h4>Dismiss on next click</h4>
+ <p>Use the <code>focus</code> trigger to dismiss popovers on their next click.</p>
+ <div class="bs-example" style="padding-bottom: 24px;">
+ <button type="button" class="btn btn-lg btn-danger bs-docs-popover-dismiss" data-toggle="popover" title="Dimissmisable popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissable popover</button>
+ </div>
+{% highlight html %}
+<button type="button" class="btn btn-lg btn-danger popover-dismiss" data-toggle="popover" title="Dimissmisable popover" data-content="And here's some amazing content. It's very engaging. Right?">Dismissable popover</button>
+{% endhighlight %}
+{% highlight js %}
+$('.popover-dismiss').popover({
+ trigger: 'focus'
+})
+{% endhighlight %}
+
<div class="bs-callout bs-callout-warning">
<h4>Multiple-line links</h4>
<p>Sometimes you want to add a popover to a hyperlink that wraps multiple lines. The default behavior of the popover plugin is to center it horizontally and vertically. Add <code>white-space: nowrap;</code> to your anchors to avoid this.</p>