2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-24 14:04:09 +03:00

Manually backport #32226

docs: use `event` instead of `e`
This commit is contained in:
XhmikosR
2020-11-23 09:45:46 +02:00
parent 57e045f0ab
commit 398ddedac7
4 changed files with 15 additions and 15 deletions
@@ -48,9 +48,9 @@ Bootstrap provides custom events for most plugins' unique actions. Generally, th
All infinitive events provide [`preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) functionality. This provides the ability to stop the execution of an action before it starts. Returning false from an event handler will also automatically call `preventDefault()`.
```js
$('#myModal').on('show.bs.modal', function (e) {
$('#myModal').on('show.bs.modal', function (event) {
if (!data) {
return e.preventDefault() // stops modal from being shown
return event.preventDefault() // stops modal from being shown
}
})
```
@@ -80,7 +80,7 @@ All programmatic API methods are **asynchronous** and return to the caller once
In order to execute an action once the transition is complete, you can listen to the corresponding event.
```js
$('#myCollapse').on('shown.bs.collapse', function (e) {
$('#myCollapse').on('shown.bs.collapse', function (event) {
// Action to execute once the collapsible area is expanded
})
```
@@ -88,7 +88,7 @@ $('#myCollapse').on('shown.bs.collapse', function (e) {
In addition a method call on a **transitioning component will be ignored**.
```js
$('#myCarousel').on('slid.bs.carousel', function (e) {
$('#myCarousel').on('slid.bs.carousel', function (event) {
$('#myCarousel').carousel('2') // Will slide to the slide 2 as soon as the transition to slide 1 is finished
})