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

@ -12,8 +12,11 @@ import { getButtonClassMap, getElementClassMap, openURL } from '../../utils/them
}
})
export class Button {
@Element() private el: HTMLElement;
@Prop({ context: 'window' }) win: Window;
@State() keyFocus: boolean;
/**
@ -145,7 +148,7 @@ export class Button {
onFocus={this.onFocus.bind(this)}
onKeyUp={this.onKeyUp.bind(this)}
onBlur={this.onBlur.bind(this)}
onClick={(ev) => openURL(this.href, ev, this.routerDirection)}>
onClick={(ev) => openURL(this.win, this.href, ev, this.routerDirection)}>
<span class='button-inner'>
<slot name='icon-only'></slot>
<slot name='start'></slot>