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; '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>>; '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>>; 'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number; 'overlayIndex': number;
@ -285,11 +285,11 @@ export namespace Components {
*/ */
'mode': Mode; '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>>; '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>>; 'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number; 'overlayIndex': number;
@ -2291,11 +2291,11 @@ export namespace Components {
*/ */
'mode': Mode; '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>>; '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>>; 'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number; 'overlayIndex': number;
@ -2642,11 +2642,11 @@ export namespace Components {
*/ */
'mode': Mode; '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>>; '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>>; 'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number; 'overlayIndex': number;
@ -2963,11 +2963,11 @@ export namespace Components {
*/ */
'mode': Mode; '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>>; '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>>; 'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number; 'overlayIndex': number;
@ -3115,11 +3115,11 @@ export namespace Components {
*/ */
'mode': Mode; '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>>; '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>>; 'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number; 'overlayIndex': number;
@ -4930,11 +4930,11 @@ export namespace Components {
*/ */
'mode': Mode; '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>>; '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>>; 'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
'overlayIndex': number; 'overlayIndex': number;

View File

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

View File

@ -46,12 +46,12 @@ A button's `role` property can either be `destructive` or `cancel`. Buttons with
## Methods ## Methods
| Method | Description | | Method | Description |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | --------------- | ------------------------------------------------------------------- |
| `dismiss` | Dismiss the action sheet overlay after it has been presented. | | `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. | | `onDidDismiss` | Returns a promise that resolves when the action-sheet did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the action-sheet will 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. |
| `present` | Present the action sheet overlay after it has been created. | | `present` | Present the action sheet overlay after it has been created. |
---------------------------------------------- ----------------------------------------------

View File

@ -181,7 +181,7 @@ export class Alert implements OverlayInterface {
@Listen('ionBackdropTap') @Listen('ionBackdropTap')
protected onBackdropTap() { protected onBackdropTap() {
return this.dismiss(null, BACKDROP); return this.dismiss(undefined, BACKDROP);
} }
@Listen('ionAlertWillDismiss') @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 * Returns a promise that resolves when the alert did dismiss.
* that is called in the same circumstances.
* *
*/ */
@Method() @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 * Returns a promise that resolves when the alert will dismiss.
* that is called in the same circumstances.
* *
*/ */
@Method() @Method()

View File

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

View File

@ -137,7 +137,7 @@ export class Loading implements OverlayInterface {
@Listen('ionBackdropTap') @Listen('ionBackdropTap')
protected onBackdropTap() { 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 * Returns a promise that resolves when the loading did dismiss.
* that is called in the same circumstances.
*/ */
@Method() @Method()
onDidDismiss(): Promise<OverlayEventDetail> { 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 * Returns a promise that resolves when the loading will dismiss.
* that is called in the same circumstances.
*/ */
@Method() @Method()
onWillDismiss(): Promise<OverlayEventDetail> { onWillDismiss(): Promise<OverlayEventDetail> {

View File

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

View File

@ -132,7 +132,7 @@ export class Modal implements OverlayInterface {
@Listen('ionBackdropTap') @Listen('ionBackdropTap')
protected onBackdropTap() { protected onBackdropTap() {
return this.dismiss(null, BACKDROP); return this.dismiss(undefined, BACKDROP);
} }
@Listen('ionModalDidPresent') @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 * Returns a promise that resolves when the modal did dismiss.
* that is called in the same circumstances.
* *
*/ */
@Method() @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 * Returns a promise that resolves when the modal will dismiss.
* that is called in the same circumstances.
* *
*/ */
@Method() @Method()

View File

@ -44,12 +44,12 @@ Modals can be created using a [Modal Controller](../../modal-controller/ModalCon
## Methods ## Methods
| Method | Description | | Method | Description |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------- | | --------------- | ------------------------------------------------------------ |
| `dismiss` | Dismiss the modal overlay after it has been presented. | | `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. | | `onDidDismiss` | Returns a promise that resolves when the modal did dismiss. |
| `onWillDismiss` | Returns a promise that resolves when the modal will dismiss. It also accepts a callback that is called in the same circumstances. | | `onWillDismiss` | Returns a promise that resolves when the modal will dismiss. |
| `present` | Present the modal overlay after it has been created. | | `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 * Returns a promise that resolves when the picker did dismiss.
* that is called in the same circustances.
*
*/ */
@Method() @Method()
onDidDismiss(): Promise<OverlayEventDetail> { 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 * Returns a promise that resolves when the picker will dismiss.
* that is called in the same circumstances.
*
*/ */
@Method() @Method()
onWillDismiss(): Promise<OverlayEventDetail> { onWillDismiss(): Promise<OverlayEventDetail> {

View File

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

View File

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

View File

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

View File

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

View File

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