From: JJ Allaire Date: Thu, 14 Feb 2013 10:26:46 +0000 (-0500) Subject: ontouchstart null check in addEventListeners X-Git-Tag: 2.3.0~51^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2cfabed9f3337d2b0dd14b686050e7c9ad60c1ff;p=reveal.js.git ontouchstart null check in addEventListeners --- 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 ); } );