From 33d47db3d55beef7f130761e6e7aff8073cb8011 Mon Sep 17 00:00:00 2001 From: Dino Date: Wed, 23 Sep 2015 17:05:34 +0200 Subject: [PATCH 1/2] added suport for isomorphic rendering --- lib/helpers/ariaAppHider.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/helpers/ariaAppHider.js b/lib/helpers/ariaAppHider.js index 02ba80eb..884620c9 100644 --- a/lib/helpers/ariaAppHider.js +++ b/lib/helpers/ariaAppHider.js @@ -1,4 +1,7 @@ -var _element = document.body; +var _element = ""; +if(typeof window !== 'undefined'){ + _element = document.body; +} function setElement(element) { if (typeof element === 'string') { @@ -39,4 +42,3 @@ exports.setElement = setElement; exports.show = show; exports.hide = hide; exports.resetForTesting = resetForTesting; - From 4c8ed9174502c651df799c6155f53852fbe67c1c Mon Sep 17 00:00:00 2001 From: Dino Date: Fri, 25 Sep 2015 22:38:44 +0200 Subject: [PATCH 2/2] imporved env check --- lib/helpers/ariaAppHider.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/helpers/ariaAppHider.js b/lib/helpers/ariaAppHider.js index 884620c9..5c17894b 100644 --- a/lib/helpers/ariaAppHider.js +++ b/lib/helpers/ariaAppHider.js @@ -1,7 +1,4 @@ -var _element = ""; -if(typeof window !== 'undefined'){ - _element = document.body; -} +var _element = typeof document !== 'undefined' ? document.body : null; function setElement(element) { if (typeof element === 'string') {