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

@ -30,8 +30,9 @@ export class VirtualScroll {
@Element() el: HTMLStencilElement;
@Prop({context: 'queue'}) queue: QueueController;
@Prop({context: 'enableListener'}) enableListener: EventListenerEnable;
@Prop({ context: 'queue' }) queue: QueueController;
@Prop({ context: 'enableListener'}) enableListener: EventListenerEnable;
@Prop({ context: 'window' }) win: Window;
/**
@ -268,7 +269,7 @@ export class VirtualScroll {
private updateCellHeight(cell: Cell, node: HTMLStencilElement | HTMLElement) {
const update = () => {
if ((node as any)['$ionCell'] === cell) {
const style = window.getComputedStyle(node);
const style = this.win.getComputedStyle(node);
const height = node.offsetHeight + parseFloat(style.getPropertyValue('margin-bottom'));
this.setCellHeight(cell, height);
}