mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
feat(overlays): adds onDidDismiss and onWillDismiss
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Component, Listen, Method } from '@stencil/core';
|
||||
import { AlertEvent, AlertOptions, OverlayController } from '../../index';
|
||||
import { AlertOptions, OverlayController } from '../../index';
|
||||
import { createOverlay, dismissOverlay, getTopOverlay, removeLastOverlay } from '../../utils/overlays';
|
||||
|
||||
@Component({
|
||||
@ -10,13 +10,13 @@ export class AlertController implements OverlayController {
|
||||
private alerts = new Map<number, HTMLIonAlertElement>();
|
||||
|
||||
@Listen('body:ionAlertWillPresent')
|
||||
protected alertWillPresent(ev: AlertEvent) {
|
||||
protected alertWillPresent(ev: any) {
|
||||
this.alerts.set(ev.target.overlayId, ev.target);
|
||||
}
|
||||
|
||||
@Listen('body:ionAlertWillDismiss')
|
||||
@Listen('body:ionAlertDidUnload')
|
||||
protected alertWillDismiss(ev: AlertEvent) {
|
||||
protected alertWillDismiss(ev: any) {
|
||||
this.alerts.delete(ev.target.overlayId);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user