aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 600a763..e6368d6 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -615,15 +615,20 @@ var Reveal = (function(){
if( config.focusBodyOnPageVisiblityChange ) {
var visibilityChange;
- if ('hidden' in document) {
+
+ if( 'hidden' in document ) {
visibilityChange = 'visibilitychange';
- } else if ('msHidden' in document) {
+ }
+ else if( 'msHidden' in document ) {
visibilityChange = 'msvisibilitychange';
- } else if ('webkitHidden' in document) {
+ }
+ else if( 'webkitHidden' in document ) {
visibilityChange = 'webkitvisibilitychange';
}
- document.addEventListener(visibilityChange, onPageVisibilityChange, false);
+ if( visibilityChange ) {
+ document.addEventListener( visibilityChange, onPageVisibilityChange, false );
+ }
}
[ 'touchstart', 'click' ].forEach( function( eventName ) {