ontouchstart null check in addEventListeners
This commit is contained in:
parent
e1872c9115
commit
2cfabed9f3
|
@ -408,7 +408,7 @@ var Reveal = (function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( config.controls && dom.controls ) {
|
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.controlsLeft.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateLeftClicked, false ); } );
|
||||||
dom.controlsRight.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateRightClicked, false ); } );
|
dom.controlsRight.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateRightClicked, false ); } );
|
||||||
dom.controlsUp.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateUpClicked, false ); } );
|
dom.controlsUp.forEach( function( el ) { el.addEventListener( actionEvent, onNavigateUpClicked, false ); } );
|
||||||
|
|
Loading…
Reference in New Issue