From 2cfabed9f3337d2b0dd14b686050e7c9ad60c1ff Mon Sep 17 00:00:00 2001 From: JJ Allaire Date: Thu, 14 Feb 2013 05:26:46 -0500 Subject: [PATCH] ontouchstart null check in addEventListeners --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index d315c89..7572569 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -408,7 +408,7 @@ var Reveal = (function(){ } if ( config.controls && dom.controls ) { - var actionEvent = 'ontouchstart' in window ? 'touchstart' : 'click'; + var actionEvent = 'ontouchstart' in window && window.ontouchstart != null ? 'touchstart' : 'click'; dom.controlsLeft.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateLeftClicked, false ); } ); dom.controlsRight.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateRightClicked, false ); } ); dom.controlsUp.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateUpClicked, false ); } );