Skip to content

Commit

Permalink
Merge pull request #12688 from twbs/document_popover_focus
Browse files Browse the repository at this point in the history
Document popover focus
  • Loading branch information
mdo committed Mar 7, 2014
2 parents 1f14842 + 0b8d27a commit 864a18f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion dist/css/bootstrap-theme.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap.css.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion docs/assets/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@
})

// popover demo
$('[data-toggle=popover]').popover()
$('.bs-docs-popover').popover()

// Popover dismiss on next click
$('.bs-docs-popover-dismiss').popover({
trigger: 'focus'
})

// button state demo
$('#loading-example-btn')
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/js/docs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/dist/css/bootstrap-theme.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/css/bootstrap.css.map

Large diffs are not rendered by default.

21 changes: 20 additions & 1 deletion docs/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,8 @@ <h3>Events</h3>
{% endhighlight %}
</div>



<!-- Popovers
================================================== -->
<div class="bs-docs-section">
Expand Down Expand Up @@ -1167,8 +1169,11 @@ <h3 class="popover-title">Popover left</h3>

<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">
Expand Down Expand Up @@ -1204,6 +1209,20 @@ <h4>Four directions</h4>
<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
Popover on right
</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">
Expand Down

0 comments on commit 864a18f

Please sign in to comment.