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

@ -43,8 +43,8 @@ export type Side = 'start' | 'end';
* @param side the side
* @param isRTL whether the application dir is rtl
*/
export function isRightSide(side: Side): boolean {
const isRTL = document.dir === 'rtl';
export function isRightSide(win: Window, side: Side): boolean {
const isRTL = win.document.dir === 'rtl';
switch (side) {
case 'start': return isRTL;
case 'end': return !isRTL;