feat(overlays): adds onDidDismiss and onWillDismiss

This commit is contained in:
Manu Mtz.-Almeida
2018-03-12 21:45:20 +01:00
parent 73f2f2b2b2
commit 7dcf8a5bd4
21 changed files with 207 additions and 164 deletions

View File

@ -1,5 +1,5 @@
import { Component, Listen, Method } from '@stencil/core';
import { OverlayController, PickerEvent, PickerOptions } from '../../index';
import { OverlayController, PickerOptions } from '../../index';
import { createOverlay, dismissOverlay, getTopOverlay, removeLastOverlay } from '../../utils/overlays';
@ -11,12 +11,13 @@ export class PickerController implements OverlayController {
private pickers = new Map<number, HTMLIonPickerElement>();
@Listen('body:ionPickerWillPresent')
protected pickerWillPresent(ev: PickerEvent) {
protected pickerWillPresent(ev: any) {
this.pickers.set(ev.target.overlayId, ev.target);
}
@Listen('body:ionPickerWillDismiss, body:ionPickerDidUnload')
protected pickerWillDismiss(ev: PickerEvent) {
@Listen('body:ionPickerWillDismiss')
@Listen('body:ionPickerDidUnload')
protected pickerWillDismiss(ev: any) {
this.pickers.delete(ev.target.overlayId);
}