diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-06-28 12:58:33 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-06-28 12:58:33 +0200 |
commit | 213c8d13541f3ac4c68098a6528d1bdcc716ab32 (patch) | |
tree | b6cd953d4f2f814aab3ab13838ae222a045cba95 /js | |
parent | 7e8fd09376a75ac793bbea4efff30d5056fea559 (diff) | |
download | fosdem-2018-presentation-213c8d13541f3ac4c68098a6528d1bdcc716ab32.tar fosdem-2018-presentation-213c8d13541f3ac4c68098a6528d1bdcc716ab32.tar.gz |
fix double-navigation on touch for some android systems
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/js/reveal.js b/js/reveal.js index edf3073..270bf63 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -291,6 +291,8 @@ features.canvas = !!document.createElement( 'canvas' ).getContext; + features.touch = !!( 'ontouchstart' in window ); + isMobileDevice = navigator.userAgent.match( /(iphone|ipod|ipad|android)/gi ); } @@ -907,14 +909,13 @@ } } - [ 'touchstart', 'click' ].forEach( function( eventName ) { - dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } ); - dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } ); - dom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } ); - dom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } ); - dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } ); - dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } ); - } ); + var eventName = features.touch ? 'touchstart' : 'click'; + dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } ); + dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } ); + dom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } ); + dom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } ); + dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } ); + dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } ); } @@ -2604,7 +2605,6 @@ // Vimeo embeds toArray( slide.querySelectorAll( 'iframe[src*="player.vimeo.com/"]' ) ).forEach( function( el ) { if( el.hasAttribute( 'data-autoplay' ) ) { - console.log(11); el.contentWindow.postMessage( '{"method":"play"}', '*' ); } }); |