Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dispose methods in our documentation #24396

Merged
merged 2 commits into from
Oct 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/4.0/components/alerts.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Note that closing an alert will remove it from the DOM.
| --- | --- |
| `$().alert()` | Makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. (Not necessary when using the data-api's auto-initialization.) |
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. |
| `$().alert('dispose')` | Destroys an element's alert. |

{% highlight js %}$(".alert").alert('close'){% endhighlight %}

Expand Down
3 changes: 2 additions & 1 deletion docs/4.0/components/buttons.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,5 @@ Note that pre-checked buttons require you to manually add the `.active` class to

| Method | Description |
| --- | --- |
| `$().button('toggle')` |Toggles push state. Gives the button the appearance that it has been activated. |
| `$().button('toggle')` | Toggles push state. Gives the button the appearance that it has been activated. |
| `$().button('dispose')` | Destroys an element's button. |
4 changes: 4 additions & 0 deletions docs/4.0/components/carousel.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ Cycles to the previous item. **Returns to the caller before the previous item ha

Cycles to the next item. **Returns to the caller before the next item has been shown** (i.e. before the `slid.bs.carousel` event occurs).

### `.carousel('dispose')`

Destroys an element's carousel.

### Events

Bootstrap's carousel class exposes two events for hooking into carousel functionality. Both events have the following additional properties:
Expand Down
4 changes: 4 additions & 0 deletions docs/4.0/components/collapse.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ Shows a collapsible element. **Returns to the caller before the collapsible elem

Hides a collapsible element. **Returns to the caller before the collapsible element has actually been hidden** (i.e. before the `hidden.bs.collapse` event occurs).

### `.collapse('dispose')`

Destroys an element's collapse.

### Events

Bootstrap's collapse class exposes a few events for hooking into collapse functionality.
Expand Down
1 change: 1 addition & 0 deletions docs/4.0/components/dropdowns.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
| --- | --- |
| `$().dropdown('toggle')` | Toggles the dropdown menu of a given navbar or tabbed navigation. |
| `$().dropdown('update')` | Updates the position of an element's dropdown. |
| `$().dropdown('dispose')` | Destroys an element's dropdown. |

### Events

Expand Down
4 changes: 4 additions & 0 deletions docs/4.0/components/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,10 @@ Manually readjust the modal's position if the height of a modal changes while it

{% highlight js %}$('#myModal').modal('handleUpdate'){% endhighlight %}

### `.modal('dispose')`

Destroys an element's modal.

### 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">`).
Expand Down
4 changes: 4 additions & 0 deletions docs/4.0/components/navs.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ Selects the given tab and shows its associated pane. Any other tab that was prev
$('#someTab').tab('show')
{% endhighlight %}

### .tab('dispose')

Destroys an element's tab.

### Events

When showing a new tab, the events fire in the following order:
Expand Down
3 changes: 3 additions & 0 deletions docs/4.0/components/scrollspy.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ $('[data-spy="scroll"]').each(function () {
})
{% endhighlight %}

### `.scrollspy('dispose')`

Destroys an element's scrollspy.

### Options

Expand Down