]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Manually backport #32226
authorXhmikosR <xhmikosr@gmail.com>
Mon, 23 Nov 2020 07:45:46 +0000 (09:45 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Tue, 24 Nov 2020 06:40:11 +0000 (08:40 +0200)
docs: use `event` instead of `e`

site/content/docs/4.5/components/list-group.md
site/content/docs/4.5/components/modal.md
site/content/docs/4.5/components/navs.md
site/content/docs/4.5/getting-started/javascript.md

index 48a1fa09973eee1a60ff35d4b4a1fdc31f2a3eb4..a064f0ee3f6e33522963061fd056aef4808f7f01 100644 (file)
@@ -281,8 +281,8 @@ You can activate a list group navigation without writing any JavaScript by simpl
 Enable tabbable list item via JavaScript (each list item needs to be activated individually):
 
 ```js
-$('#myList a').on('click', function (e) {
-  e.preventDefault()
+$('#myList a').on('click', function (event) {
+  event.preventDefault()
   $(this).tab('show')
 })
 ```
@@ -384,8 +384,8 @@ If no tab was already active, the `hide.bs.tab` and `hidden.bs.tab` events will
 </table>
 
 ```js
-$('a[data-toggle="list"]').on('shown.bs.tab', function (e) {
-  e.target // newly activated tab
-  e.relatedTarget // previous active tab
+$('a[data-toggle="list"]').on('shown.bs.tab', function (event) {
+  event.target // newly activated tab
+  event.relatedTarget // previous active tab
 })
 ```
index ac564a9ed491f1e10ffbc4a7e8053b4df0ce69e1..92a56ddd0aaad9dd41f23a1d4ead104f6994c518 100644 (file)
@@ -820,7 +820,7 @@ Bootstrap's modal class exposes a few events for hooking into modal functionalit
 </table>
 
 ```js
-$('#myModal').on('hidden.bs.modal', function (e) {
+$('#myModal').on('hidden.bs.modal', function (event) {
   // do something...
 })
 ```
index 9faedb598d22a9e3329ccf21bcc38edd49936834..322d1b780d6686333b17f1428df1cf5832c8a62f 100644 (file)
@@ -526,8 +526,8 @@ You can activate a tab or pill navigation without writing any JavaScript by simp
 Enable tabbable tabs via JavaScript (each tab needs to be activated individually):
 
 ```js
-$('#myTab a').on('click', function (e) {
-  e.preventDefault()
+$('#myTab a').on('click', function (event) {
+  event.preventDefault()
   $(this).tab('show')
 })
 ```
@@ -645,8 +645,8 @@ If no tab was already active, then the `hide.bs.tab` and `hidden.bs.tab` events
 </table>
 
 ```js
-$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
-  e.target // newly activated tab
-  e.relatedTarget // previous active tab
+$('a[data-toggle="tab"]').on('shown.bs.tab', function (event) {
+  event.target // newly activated tab
+  event.relatedTarget // previous active tab
 })
 ```
index 015ea5fdb2eaa69abfb60104aa1cae27a2fd25c9..faa01c48dfa0fe2976c32cfb6c83c5ef4f8c01c0 100644 (file)
@@ -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
 })