Skip to content

Commit af0d981

Browse files
authoredDec 31, 2024··
docs(playgrounds): rename ev to event for consistency (#3982)
1 parent e2542fe commit af0d981

File tree

205 files changed

+616
-622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+616
-622
lines changed
 

‎docs/developing/hardware-back-button.md‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ The `ionBackButton` event will not be emitted when running an app in a browser o
6767
<TabItem value="javascript">
6868
6969
```javascript
70-
document.addEventListener('ionBackButton', (ev) => {
71-
ev.detail.register(10, () => {
70+
document.addEventListener('ionBackButton', (event) => {
71+
event.detail.register(10, () => {
7272
console.log('Handler was called!');
7373
});
7474
});
@@ -108,8 +108,8 @@ constructor(private platform: Platform) {
108108
<TabItem value="react">
109109
110110
```tsx
111-
document.addEventListener('ionBackButton', (ev) => {
112-
ev.detail.register(10, () => {
111+
document.addEventListener('ionBackButton', (event) => {
112+
event.detail.register(10, () => {
113113
console.log('Handler was called!');
114114
});
115115
});
@@ -157,12 +157,12 @@ Each hardware back button callback has a `processNextHandler` parameter. Calling
157157
<TabItem value="javascript">
158158
159159
```javascript
160-
document.addEventListener('ionBackButton', (ev) => {
161-
ev.detail.register(5, () => {
160+
document.addEventListener('ionBackButton', (event) => {
161+
event.detail.register(5, () => {
162162
console.log('Another handler was called!');
163163
});
164164
165-
ev.detail.register(10, (processNextHandler) => {
165+
event.detail.register(10, (processNextHandler) => {
166166
console.log('Handler was called!');
167167
168168
processNextHandler();
@@ -216,12 +216,12 @@ constructor(private platform: Platform) {
216216
<TabItem value="react">
217217
218218
```tsx
219-
document.addEventListener('ionBackButton', (ev) => {
220-
ev.detail.register(5, () => {
219+
document.addEventListener('ionBackButton', (event) => {
220+
event.detail.register(5, () => {
221221
console.log('Another handler was called!');
222222
});
223223
224-
ev.detail.register(10, (processNextHandler) => {
224+
event.detail.register(10, (processNextHandler) => {
225225
console.log('Handler was called!');
226226
227227
processNextHandler();
@@ -261,16 +261,16 @@ This example shows how to indicate to Ionic Framework that you want the next han
261261
Internally, Ionic Framework uses something similar to a priority queue to manage hardware back button handlers. The handler with the largest priority value will be called first. In the event that there are multiple handlers with the same priority value, the _last_ handler of the same priority added to this queue will be the first handler to be called.
262262

263263
```javascript
264-
document.addEventListener('ionBackButton', (ev) => {
264+
document.addEventListener('ionBackButton', (event) => {
265265
// Handler A
266-
ev.detail.register(10, (processNextHandler) => {
266+
event.detail.register(10, (processNextHandler) => {
267267
console.log('Handler A was called!');
268268

269269
processNextHandler();
270270
});
271271

272272
// Handler B
273-
ev.detail.register(10, (processNextHandler) => {
273+
event.detail.register(10, (processNextHandler) => {
274274
console.log('Handler B was called!');
275275

276276
processNextHandler();
@@ -305,8 +305,8 @@ import { App } from '@capacitor/app';
305305
...
306306
307307
const routerEl = document.querySelector('ion-router');
308-
document.addEventListener('ionBackButton', (ev: BackButtonEvent) => {
309-
ev.detail.register(-1, () => {
308+
document.addEventListener('ionBackButton', (event: BackButtonEvent) => {
309+
event.detail.register(-1, () => {
310310
const path = window.location.pathname;
311311
if (path === routerEl.root) {
312312
App.exitApp();
@@ -368,8 +368,8 @@ import { App } from '@capacitor/app';
368368
...
369369
370370
const ionRouter = useIonRouter();
371-
document.addEventListener('ionBackButton', (ev) => {
372-
ev.detail.register(-1, () => {
371+
document.addEventListener('ionBackButton', (event) => {
372+
event.detail.register(-1, () => {
373373
if (!ionRouter.canGoBack()) {
374374
App.exitApp();
375375
}

‎docs/developing/keyboard.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Detecting the presence of an on-screen keyboard is useful for adjusting the posi
9090
<TabItem value="javascript">
9191
9292
```javascript
93-
window.addEventListener('ionKeyboardDidShow', ev => {
94-
const { keyboardHeight } = ev;
93+
window.addEventListener('ionKeyboardDidShow', event => {
94+
const { keyboardHeight } = event;
9595
// Do something with the keyboard height such as translating an input above the keyboard.
9696
});
9797
@@ -108,8 +108,8 @@ import { Platform } from '@ionic/angular';
108108
...
109109
110110
constructor(private platform: Platform) {
111-
this.platform.keyboardDidShow.subscribe(ev => {
112-
const { keyboardHeight } = ev;
111+
this.platform.keyboardDidShow.subscribe(event => {
112+
const { keyboardHeight } = event;
113113
// Do something with the keyboard height such as translating an input above the keyboard.
114114
});
115115
@@ -127,8 +127,8 @@ import { Platform } from '@ionic/angular/standalone';
127127
...
128128
129129
constructor(private platform: Platform) {
130-
this.platform.keyboardDidShow.subscribe(ev => {
131-
const { keyboardHeight } = ev;
130+
this.platform.keyboardDidShow.subscribe(event => {
131+
const { keyboardHeight } = event;
132132
// Do something with the keyboard height such as translating an input above the keyboard.
133133
});
134134

0 commit comments

Comments
 (0)
Please sign in to comment.