1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-18 11:21:23 +02:00

remove underscore for static methods

This commit is contained in:
Johann-S
2019-07-28 15:24:46 +02:00
parent 144220f0c5
commit dcba526775
32 changed files with 215 additions and 215 deletions

View File

@@ -133,10 +133,10 @@ This makes an alert listen for click events on descendant elements which have th
</tr>
<tr>
<td>
<code>_getInstance</code>
<code>getInstance</code>
</td>
<td>
Static method which allows you to get the alert instance associated to a DOM element, you can use it like this: <code>bootstrap.Alert._getInstance(alert)</code>
Static method which allows you to get the alert instance associated to a DOM element, you can use it like this: <code>bootstrap.Alert.getInstance(alert)</code>
</td>
</tr>
</tbody>
@@ -144,7 +144,7 @@ This makes an alert listen for click events on descendant elements which have th
{{< highlight js >}}
var alertNode = document.querySelector('.alert')
var alert = bootstrap.Alert._getInstance(alertNode)
var alert = bootstrap.Alert.getInstance(alertNode)
alert.close()
{{< /highlight >}}

View File

@@ -329,7 +329,7 @@ var carousel = new bootstrap.Carousel(myCarousel, {
<td>Destroys an element's carousel.</td>
</tr>
<tr>
<td><code>_getInstance</code></td>
<td><code>getInstance</code></td>
<td>Static method which allows you to get the carousel instance associated with a DOM element.</td>
</tr>
</tbody>

View File

@@ -227,7 +227,7 @@ var bsCollapse = new bootstrap.Collapse(myCollapse, {
<td>Destroys an element's collapse.</td>
</tr>
<tr>
<td><code>_getInstance</code></td>
<td><code>getInstance</code></td>
<td>Static method which allows you to get the collapse instance associated with a DOM element.</td>
</tr>
</tbody>

View File

@@ -901,7 +901,7 @@ Note when `boundary` is set to any value other than `'scrollParent'`, the style
</td>
</tr>
<tr>
<td><code>_getInstance</code></td>
<td><code>getInstance</code></td>
<td>
Static method which allows you to get the dropdown instance associated with a DOM element.
</td>

View File

@@ -820,13 +820,13 @@ Destroys an element's modal.
{{< highlight js >}}myModal.dispose(){{< /highlight >}}
#### _getInstance
#### getInstance
*Static* method which allows you to get the modal instance associated with a DOM element
{{< highlight js >}}
var myModalEl = document.getElementById('myModal')
var modal = bootstrap.Modal._getInstance(myModalEl) // Returns a Bootstrap modal instance
var modal = bootstrap.Modal.getInstance(myModalEl) // Returns a Bootstrap modal instance
{{< /highlight >}}
### Events

View File

@@ -345,13 +345,13 @@ Updates the position of an element's popover.
{{< highlight js >}}myPopover.update(){{< /highlight >}}
#### _getInstance
#### getInstance
*Static* method which allows you to get the popover instance associated with a DOM element
{{< highlight js >}}
var exampleTriggerEl = document.getElementById('example')
var popover = bootstrap.Popover._getInstance(exampleTriggerEl) // Returns a Bootstrap popover instance
var popover = bootstrap.Popover.getInstance(exampleTriggerEl) // Returns a Bootstrap popover instance
{{< /highlight >}}
### Events

View File

@@ -75,7 +75,7 @@ var modal = new bootstrap.Modal(myModalEl) // initialized with defaults
var modal = new bootstrap.Modal(myModalEl, { keyboard: false }) // initialized with no keyboard
{{< /highlight >}}
If you'd like to get a particular plugin instance, each plugin exposes a `_getInstance` method. In order to retrieve it directly from an element, do this: `bootstrap.Popover._getInstance(myPopoverEl)`.
If you'd like to get a particular plugin instance, each plugin exposes a `getInstance` method. In order to retrieve it directly from an element, do this: `bootstrap.Popover.getInstance(myPopoverEl)`.
### Asynchronous functions and transitions
@@ -95,7 +95,7 @@ In addition a method call on a **transitioning component will be ignored**.
{{< highlight js >}}
var myCarouselEl = document.getElementById('myCarousel')
var carousel = bootstrap.Carousel._getInstance(myCarouselEl) // Retrieve a Carousel instance
var carousel = bootstrap.Carousel.getInstance(myCarouselEl) // Retrieve a Carousel instance
myCarouselEl.addEventListener('slid.bs.carousel', function (e) {
carousel.to('2') // Will slide to the slide 2 as soon as the transition to slide 1 is finished