fix(prerender): local references to window/document

This commit is contained in:
Manu Mtz.-Almeida
2018-04-19 13:26:49 +02:00
parent 86a6cde4a1
commit 78bd146ad2
42 changed files with 174 additions and 139 deletions

View File

@ -1,4 +1,4 @@
import { Component, Listen, Method } from '@stencil/core';
import { Component, Listen, Method, Prop } from '@stencil/core';
import { ActionSheetOptions } from '../../index';
import { OverlayController, createOverlay, dismissOverlay, getTopOverlay, removeLastOverlay } from '../../utils/overlays';
@ -9,6 +9,8 @@ export class ActionSheetController implements OverlayController {
private actionSheets = new Map<number, HTMLIonActionSheetElement>();
@Prop({ context: 'document' }) doc: Document;
@Listen('body:ionActionSheetWillPresent')
protected actionSheetWillPresent(ev: any) {
this.actionSheets.set(ev.target.overlayId, ev.target);
@ -30,7 +32,7 @@ export class ActionSheetController implements OverlayController {
*/
@Method()
create(opts?: ActionSheetOptions): Promise<HTMLIonActionSheetElement> {
return createOverlay(document.createElement('ion-action-sheet'), opts);
return createOverlay(this.doc.createElement('ion-action-sheet'), opts);
}
/*