docs(overlay): onDidDismiss() and onWillDismiss()

This commit is contained in:
Manu Mtz.-Almeida
2018-09-07 16:44:57 +02:00
parent 2f2a255436
commit bf486e2c99
15 changed files with 75 additions and 92 deletions

View File

@ -126,11 +126,11 @@ export namespace Components {
*/
'mode': Mode;
/**
* Returns a promise that resolves when the action-sheet did dismiss. It also accepts a callback that is called in the same circustances.
* Returns a promise that resolves when the action-sheet did dismiss.
*/
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
/**
* Returns a promise that resolves when the action-sheet will dismiss. It also accepts a callback that is called in the same circustances.
* Returns a promise that resolves when the action-sheet will dismiss.
*/
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number;
@ -285,11 +285,11 @@ export namespace Components {
*/
'mode': Mode;
/**
* Returns a promise that resolves when the alert did dismiss. It also accepts a callback that is called in the same circumstances.
* Returns a promise that resolves when the alert did dismiss.
*/
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
/**
* Returns a promise that resolves when the alert will dismiss. It also accepts a callback that is called in the same circumstances.
* Returns a promise that resolves when the alert will dismiss.
*/
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number;
@ -2291,11 +2291,11 @@ export namespace Components {
*/
'mode': Mode;
/**
* Returns a promise that resolves when the loading did dismiss. It also accepts a callback that is called in the same circumstances.
* Returns a promise that resolves when the loading did dismiss.
*/
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
/**
* Returns a promise that resolves when the loading will dismiss. It also accepts a callback that is called in the same circumstances.
* Returns a promise that resolves when the loading will dismiss.
*/
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number;
@ -2642,11 +2642,11 @@ export namespace Components {
*/
'mode': Mode;
/**
* Returns a promise that resolves when the modal did dismiss. It also accepts a callback that is called in the same circumstances.
* Returns a promise that resolves when the modal did dismiss.
*/
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
/**
* Returns a promise that resolves when the modal will dismiss. It also accepts a callback that is called in the same circumstances.
* Returns a promise that resolves when the modal will dismiss.
*/
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number;
@ -2963,11 +2963,11 @@ export namespace Components {
*/
'mode': Mode;
/**
* Returns a promise that resolves when the picker did dismiss. It also accepts a callback that is called in the same circustances.
* Returns a promise that resolves when the picker did dismiss.
*/
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
/**
* Returns a promise that resolves when the picker will dismiss. It also accepts a callback that is called in the same circumstances.
* Returns a promise that resolves when the picker will dismiss.
*/
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number;
@ -3115,11 +3115,11 @@ export namespace Components {
*/
'mode': Mode;
/**
* Returns a promise that resolves when the popover did dismiss. It also accepts a callback that is called in the same circustances.
* Returns a promise that resolves when the popover did dismiss.
*/
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
/**
* Returns a promise that resolves when the popover will dismiss. It also accepts a callback that is called in the same circustances.
* Returns a promise that resolves when the popover will dismiss.
*/
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number;
@ -4930,11 +4930,11 @@ export namespace Components {
*/
'mode': Mode;
/**
* Returns a promise that resolves when the toast did dismiss. It also accepts a callback that is called in the same circustances.
* Returns a promise that resolves when the toast did dismiss.
*/
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
/**
* Returns a promise that resolves when the toast will dismiss. It also accepts a callback that is called in the same circustances.
* Returns a promise that resolves when the toast will dismiss.
*/
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number;

View File

@ -125,7 +125,7 @@ export class ActionSheet implements OverlayInterface {
@Listen('ionBackdropTap')
protected onBackdropTap() {
return this.dismiss(null, BACKDROP);
return this.dismiss(undefined, BACKDROP);
}
@Listen('ionActionSheetWillDismiss')
@ -154,9 +154,7 @@ export class ActionSheet implements OverlayInterface {
}
/**
* Returns a promise that resolves when the action-sheet did dismiss. It also accepts a callback
* that is called in the same circustances.
*
* Returns a promise that resolves when the action-sheet did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
@ -164,8 +162,7 @@ export class ActionSheet implements OverlayInterface {
}
/**
* Returns a promise that resolves when the action-sheet will dismiss. It also accepts a callback
* that is called in the same circustances.
* Returns a promise that resolves when the action-sheet will dismiss.
*
*/
@Method()

View File

@ -47,10 +47,10 @@ A button's `role` property can either be `destructive` or `cancel`. Buttons with
## Methods
| Method | Description |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | ------------------------------------------------------------------- |
| `dismiss` | Dismiss the action sheet overlay after it has been presented. |
| `onDidDismiss` | Returns a promise that resolves when the action-sheet did dismiss. It also accepts a callback that is called in the same circustances. |
| `onWillDismiss` | Returns a promise that resolves when the action-sheet will dismiss. It also accepts a callback that is called in the same circustances. |
| `onDidDismiss` | Returns a promise that resolves when the action-sheet did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the action-sheet will dismiss. |
| `present` | Present the action sheet overlay after it has been created. |

View File

@ -181,7 +181,7 @@ export class Alert implements OverlayInterface {
@Listen('ionBackdropTap')
protected onBackdropTap() {
return this.dismiss(null, BACKDROP);
return this.dismiss(undefined, BACKDROP);
}
@Listen('ionAlertWillDismiss')
@ -210,8 +210,7 @@ export class Alert implements OverlayInterface {
}
/**
* Returns a promise that resolves when the alert did dismiss. It also accepts a callback
* that is called in the same circumstances.
* Returns a promise that resolves when the alert did dismiss.
*
*/
@Method()
@ -220,8 +219,7 @@ export class Alert implements OverlayInterface {
}
/**
* Returns a promise that resolves when the alert will dismiss. It also accepts a callback
* that is called in the same circumstances.
* Returns a promise that resolves when the alert will dismiss.
*
*/
@Method()

View File

@ -58,10 +58,10 @@ Alerts can also include several different inputs whose data can be passed back t
## Methods
| Method | Description |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | ------------------------------------------------------------ |
| `dismiss` | Dismiss the alert overlay after it has been presented. |
| `onDidDismiss` | Returns a promise that resolves when the alert did dismiss. It also accepts a callback that is called in the same circumstances. |
| `onWillDismiss` | Returns a promise that resolves when the alert will dismiss. It also accepts a callback that is called in the same circumstances. |
| `onDidDismiss` | Returns a promise that resolves when the alert did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the alert will dismiss. |
| `present` | Present the alert overlay after it has been created. |

View File

@ -137,7 +137,7 @@ export class Loading implements OverlayInterface {
@Listen('ionBackdropTap')
protected onBackdropTap() {
return this.dismiss(null, BACKDROP);
return this.dismiss(undefined, BACKDROP);
}
/**
@ -167,8 +167,7 @@ export class Loading implements OverlayInterface {
}
/**
* Returns a promise that resolves when the loading did dismiss. It also accepts a callback
* that is called in the same circumstances.
* Returns a promise that resolves when the loading did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
@ -176,8 +175,7 @@ export class Loading implements OverlayInterface {
}
/**
* Returns a promise that resolves when the loading will dismiss. It also accepts a callback
* that is called in the same circumstances.
* Returns a promise that resolves when the loading will dismiss.
*/
@Method()
onWillDismiss(): Promise<OverlayEventDetail> {

View File

@ -50,10 +50,10 @@ The loading indicator can be dismissed automatically after a specific amount of
## Methods
| Method | Description |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | -------------------------------------------------------------- |
| `dismiss` | Dismiss the loading overlay after it has been presented. |
| `onDidDismiss` | Returns a promise that resolves when the loading did dismiss. It also accepts a callback that is called in the same circumstances. |
| `onWillDismiss` | Returns a promise that resolves when the loading will dismiss. It also accepts a callback that is called in the same circumstances. |
| `onDidDismiss` | Returns a promise that resolves when the loading did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the loading will dismiss. |
| `present` | Present the loading overlay after it has been created. |

View File

@ -132,7 +132,7 @@ export class Modal implements OverlayInterface {
@Listen('ionBackdropTap')
protected onBackdropTap() {
return this.dismiss(null, BACKDROP);
return this.dismiss(undefined, BACKDROP);
}
@Listen('ionModalDidPresent')
@ -186,8 +186,7 @@ export class Modal implements OverlayInterface {
}
/**
* Returns a promise that resolves when the modal did dismiss. It also accepts a callback
* that is called in the same circumstances.
* Returns a promise that resolves when the modal did dismiss.
*
*/
@Method()
@ -196,8 +195,7 @@ export class Modal implements OverlayInterface {
}
/**
* Returns a promise that resolves when the modal will dismiss. It also accepts a callback
* that is called in the same circumstances.
* Returns a promise that resolves when the modal will dismiss.
*
*/
@Method()

View File

@ -45,10 +45,10 @@ Modals can be created using a [Modal Controller](../../modal-controller/ModalCon
## Methods
| Method | Description |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | ------------------------------------------------------------ |
| `dismiss` | Dismiss the modal overlay after it has been presented. |
| `onDidDismiss` | Returns a promise that resolves when the modal did dismiss. It also accepts a callback that is called in the same circumstances. |
| `onWillDismiss` | Returns a promise that resolves when the modal will dismiss. It also accepts a callback that is called in the same circumstances. |
| `onDidDismiss` | Returns a promise that resolves when the modal did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the modal will dismiss. |
| `present` | Present the modal overlay after it has been created. |

View File

@ -170,9 +170,7 @@ export class Picker implements OverlayInterface {
}
/**
* Returns a promise that resolves when the picker did dismiss. It also accepts a callback
* that is called in the same circustances.
*
* Returns a promise that resolves when the picker did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
@ -180,9 +178,7 @@ export class Picker implements OverlayInterface {
}
/**
* Returns a promise that resolves when the picker will dismiss. It also accepts a callback
* that is called in the same circumstances.
*
* Returns a promise that resolves when the picker will dismiss.
*/
@Method()
onWillDismiss(): Promise<OverlayEventDetail> {

View File

@ -40,11 +40,11 @@ A Picker is a dialog that displays a row of buttons and columns underneath. It a
## Methods
| Method | Description |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | ------------------------------------------------------------- |
| `dismiss` | Dismiss the picker overlay after it has been presented. |
| `getColumn` | Returns the column the matches the specified name |
| `onDidDismiss` | Returns a promise that resolves when the picker did dismiss. It also accepts a callback that is called in the same circustances. |
| `onWillDismiss` | Returns a promise that resolves when the picker will dismiss. It also accepts a callback that is called in the same circumstances. |
| `onDidDismiss` | Returns a promise that resolves when the picker did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the picker will dismiss. |
| `present` | Present the picker overlay after it has been created. |

View File

@ -142,7 +142,7 @@ export class Popover implements OverlayInterface {
@Listen('ionBackdropTap')
protected onBackdropTap() {
return this.dismiss(null, BACKDROP);
return this.dismiss(undefined, BACKDROP);
}
@Listen('ionPopoverDidPresent')
@ -196,9 +196,7 @@ export class Popover implements OverlayInterface {
}
/**
* Returns a promise that resolves when the popover did dismiss. It also accepts a callback
* that is called in the same circustances.
*
* Returns a promise that resolves when the popover did dismiss.
*/
@Method()
onDidDismiss(): Promise<OverlayEventDetail> {
@ -206,9 +204,7 @@ export class Popover implements OverlayInterface {
}
/**
* Returns a promise that resolves when the popover will dismiss. It also accepts a callback
* that is called in the same circustances.
*
* Returns a promise that resolves when the popover will dismiss.
*/
@Method()
onWillDismiss(): Promise<OverlayEventDetail> {

View File

@ -49,10 +49,10 @@ To present a popover, call the `present` method on a popover instance. In order
## Methods
| Method | Description |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | -------------------------------------------------------------- |
| `dismiss` | Dismiss the popover overlay after it has been presented. |
| `onDidDismiss` | Returns a promise that resolves when the popover did dismiss. It also accepts a callback that is called in the same circustances. |
| `onWillDismiss` | Returns a promise that resolves when the popover will dismiss. It also accepts a callback that is called in the same circustances. |
| `onDidDismiss` | Returns a promise that resolves when the popover did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the popover will dismiss. |
| `present` | Present the popover overlay after it has been created. |

View File

@ -52,10 +52,10 @@ The toast can be dismissed automatically after a specific amount of time by pass
## Methods
| Method | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| --------------- | ------------------------------------------------------------ |
| `dismiss` | Dismiss the toast overlay after it has been presented. |
| `onDidDismiss` | Returns a promise that resolves when the toast did dismiss. It also accepts a callback that is called in the same circustances. |
| `onWillDismiss` | Returns a promise that resolves when the toast will dismiss. It also accepts a callback that is called in the same circustances. |
| `onDidDismiss` | Returns a promise that resolves when the toast did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the toast will dismiss. |
| `present` | Present the toast overlay after it has been created. |

View File

@ -36,7 +36,7 @@ export function createOverlay<T extends HTMLIonOverlayElement>(element: T, opts:
function closeTopOverlay(doc: Document) {
const lastOverlay = getOverlay(doc);
if (lastOverlay && lastOverlay.backdropDismiss) {
return lastOverlay.dismiss(null, BACKDROP);
return lastOverlay.dismiss(undefined, BACKDROP);
}
return Promise.resolve();
}