diff options
| author | Pierre Vanduynslager <[email protected]> | 2017-04-08 18:43:25 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-04-08 18:43:25 -0400 |
| commit | fe72daf2b34263d3cfc9bc77e9998cd22adfa34d (patch) | |
| tree | 15dc9fc6fcb513362ba112d52ab01b568b423709 /docs/components/modal.md | |
| parent | f5cc59145642d78d7abbdf38fee1905786da5367 (diff) | |
| parent | feb35b94a61c4d6016be8d1773a79a6bbe57d856 (diff) | |
| download | bootstrap-fe72daf2b34263d3cfc9bc77e9998cd22adfa34d.tar.xz bootstrap-fe72daf2b34263d3cfc9bc77e9998cd22adfa34d.zip | |
Merge branch 'v4-dev' into dropdown-keyboard
Diffstat (limited to 'docs/components/modal.md')
| -rw-r--r-- | docs/components/modal.md | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/components/modal.md b/docs/components/modal.md index deb25c4dc..19254b880 100644 --- a/docs/components/modal.md +++ b/docs/components/modal.md @@ -63,7 +63,7 @@ Below is a _static_ modal example (meaning its `position` and `display` have bee </div> {% highlight html %} -<div class="modal fade"> +<div class="modal"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> @@ -410,7 +410,7 @@ For modals that simply appear rather than fade in to view, remove the `.fade` cl ### Dynamic heights -If the height of a modal changes while it is open, you should call `$('#myModal').data('bs.modal').handleUpdate()` to readjust the modal's position in case a scrollbar appears. +If the height of a modal changes while it is open, you should call `$('#myModal').data('bs.modal').handleUpdate()` or `$('#myModal').modal('handleUpdate')` to readjust the modal's position in case a scrollbar appears. ### Accessibility @@ -547,6 +547,9 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap ### Methods +{% capture callout-include %}{% include callout-danger-async-methods.md %}{% endcapture %} +{{ callout-include | markdownify }} + #### `.modal(options)` Activates your content as a modal. Accepts an optional options `object`. @@ -575,6 +578,12 @@ Manually hides a modal. **Returns to the caller before the modal has actually be {% highlight js %}$('#myModal').modal('hide'){% endhighlight %} +#### `.modal('handleUpdate')` + +Manually readjust the modal's position if the height of a modal changes while it is open (i.e. in case a scrollbar appears). + +{% highlight js %}$('#myModal').modal('handleUpdate'){% endhighlight %} + ### Events Bootstrap's modal class exposes a few events for hooking into modal functionality. All modal events are fired at the modal itself (i.e. at the `<div class="modal">`). |
