fix(overlays): dismiss last overlay

This commit is contained in:
Manu Mtz.-Almeida
2018-08-25 16:49:04 +02:00
parent 8bf60e7388
commit c1c51025f3
9 changed files with 15 additions and 15 deletions

View File

@ -74,7 +74,7 @@ export namespace Components {
/**
* Dismiss the open action sheet overlay.
*/
'dismiss': (data?: any, role?: string | undefined, actionSheetId?: number) => Promise<void>;
'dismiss': (data?: any, role?: string | undefined, actionSheetId?: number | undefined) => Promise<void>;
/**
* Get the most recently opened action sheet overlay.
*/
@ -223,7 +223,7 @@ export namespace Components {
/**
* Dismiss the open alert overlay.
*/
'dismiss': (data?: any, role?: string | undefined, alertId?: number) => Promise<void>;
'dismiss': (data?: any, role?: string | undefined, alertId?: number | undefined) => Promise<void>;
/**
* Get the most recently opened alert overlay.
*/
@ -2229,7 +2229,7 @@ export namespace Components {
/**
* Dismiss the open loading overlay.
*/
'dismiss': (data?: any, role?: string | undefined, loadingId?: number) => Promise<void>;
'dismiss': (data?: any, role?: string | undefined, loadingId?: number | undefined) => Promise<void>;
/**
* Get the most recently opened loading overlay.
*/
@ -2572,7 +2572,7 @@ export namespace Components {
/**
* Dismiss the open modal overlay.
*/
'dismiss': (data?: any, role?: string | undefined, modalId?: number) => Promise<void>;
'dismiss': (data?: any, role?: string | undefined, modalId?: number | undefined) => Promise<void>;
/**
* Get the most recently opened modal overlay.
*/
@ -2880,7 +2880,7 @@ export namespace Components {
interface IonPickerController {
'create': (opts?: PickerOptions | undefined) => Promise<HTMLIonPickerElement>;
'dismiss': (data?: any, role?: string | undefined, pickerId?: number) => Promise<void>;
'dismiss': (data?: any, role?: string | undefined, pickerId?: number | undefined) => Promise<void>;
'getTop': () => HTMLIonPickerElement;
}
interface IonPickerControllerAttributes extends StencilHTMLAttributes {}
@ -3024,7 +3024,7 @@ export namespace Components {
/**
* Dismiss the open popover overlay.
*/
'dismiss': (data?: any, role?: string | undefined, popoverId?: number) => Promise<void>;
'dismiss': (data?: any, role?: string | undefined, popoverId?: number | undefined) => Promise<void>;
/**
* Get the most recently opened popover overlay.
*/
@ -4861,7 +4861,7 @@ export namespace Components {
/**
* Dismiss the open toast overlay.
*/
'dismiss': (data?: any, role?: string | undefined, toastId?: number) => Promise<void>;
'dismiss': (data?: any, role?: string | undefined, toastId?: number | undefined) => Promise<void>;
/**
* Get the most recently opened toast overlay.
*/

View File

@ -22,7 +22,7 @@ export class ActionSheetController implements OverlayController {
* Dismiss the open action sheet overlay.
*/
@Method()
dismiss(data?: any, role?: string, actionSheetId = -1) {
dismiss(data?: any, role?: string, actionSheetId?: number) {
return dismissOverlay(this.doc, data, role, 'ion-action-sheet', actionSheetId);
}

View File

@ -22,7 +22,7 @@ export class AlertController implements OverlayController {
* Dismiss the open alert overlay.
*/
@Method()
dismiss(data?: any, role?: string, alertId = -1) {
dismiss(data?: any, role?: string, alertId?: number) {
return dismissOverlay(this.doc, data, role, 'ion-alert', alertId);
}

View File

@ -22,7 +22,7 @@ export class LoadingController implements OverlayController {
* Dismiss the open loading overlay.
*/
@Method()
dismiss(data?: any, role?: string, loadingId = -1) {
dismiss(data?: any, role?: string, loadingId?: number) {
return dismissOverlay(this.doc, data, role, 'ion-loading', loadingId);
}

View File

@ -22,7 +22,7 @@ export class ModalController implements OverlayController {
* Dismiss the open modal overlay.
*/
@Method()
dismiss(data?: any, role?: string, modalId = -1) {
dismiss(data?: any, role?: string, modalId?: number) {
return dismissOverlay(this.doc, data, role, 'ion-modal', modalId);
}

View File

@ -23,7 +23,7 @@ export class PickerController implements OverlayController {
* Dismiss the open picker overlay.
*/
@Method()
dismiss(data?: any, role?: string, pickerId = -1) {
dismiss(data?: any, role?: string, pickerId?: number) {
return dismissOverlay(this.doc, data, role, 'ion-picker', pickerId);
}

View File

@ -22,7 +22,7 @@ export class PopoverController implements OverlayController {
* Dismiss the open popover overlay.
*/
@Method()
dismiss(data?: any, role?: string, popoverId = -1) {
dismiss(data?: any, role?: string, popoverId?: number) {
return dismissOverlay(this.doc, data, role, 'ion-popover', popoverId);
}

View File

@ -22,7 +22,7 @@ export class ToastController implements OverlayController {
* Dismiss the open toast overlay.
*/
@Method()
dismiss(data?: any, role?: string, toastId = -1) {
dismiss(data?: any, role?: string, toastId?: number) {
return dismissOverlay(this.doc, data, role, 'ion-toast', toastId);
}

View File

@ -41,7 +41,7 @@ export function connectListeners(doc: Document) {
}
}
export function dismissOverlay(doc: Document, data: any, role: string | undefined, overlayTag: string, id: number): Promise<void> {
export function dismissOverlay(doc: Document, data: any, role: string | undefined, overlayTag: string, id?: number): Promise<void> {
const overlay = getOverlay(doc, overlayTag, id);
if (!overlay) {
return Promise.reject('overlay does not exist');