fix double-navigation on touch for some android systems

This commit is contained in:
Hakim El Hattab 2014-06-28 12:58:33 +02:00
parent 7e8fd09376
commit 213c8d1354
2 changed files with 12 additions and 9 deletions

View File

@ -248,6 +248,8 @@ body {
z-index: 30; z-index: 30;
right: 10px; right: 10px;
bottom: 10px; bottom: 10px;
-webkit-user-select: none;
} }
.reveal .controls div { .reveal .controls div {
@ -258,6 +260,7 @@ body {
border: 12px solid transparent; border: 12px solid transparent;
-moz-transform: scale(.9999); -moz-transform: scale(.9999);
-webkit-tap-highlight-color: rgba( 0, 0, 0, 0 );
-webkit-transition: all 0.2s ease; -webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease; -moz-transition: all 0.2s ease;

View File

@ -291,6 +291,8 @@
features.canvas = !!document.createElement( 'canvas' ).getContext; features.canvas = !!document.createElement( 'canvas' ).getContext;
features.touch = !!( 'ontouchstart' in window );
isMobileDevice = navigator.userAgent.match( /(iphone|ipod|ipad|android)/gi ); isMobileDevice = navigator.userAgent.match( /(iphone|ipod|ipad|android)/gi );
} }
@ -907,14 +909,13 @@
} }
} }
[ 'touchstart', 'click' ].forEach( function( eventName ) { var eventName = features.touch ? 'touchstart' : 'click';
dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } ); dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } );
dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } ); dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } );
dom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } ); dom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } );
dom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } ); dom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } );
dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } ); dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } );
dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } ); dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } );
} );
} }
@ -2604,7 +2605,6 @@
// Vimeo embeds // Vimeo embeds
toArray( slide.querySelectorAll( 'iframe[src*="player.vimeo.com/"]' ) ).forEach( function( el ) { toArray( slide.querySelectorAll( 'iframe[src*="player.vimeo.com/"]' ) ).forEach( function( el ) {
if( el.hasAttribute( 'data-autoplay' ) ) { if( el.hasAttribute( 'data-autoplay' ) ) {
console.log(11);
el.contentWindow.postMessage( '{"method":"play"}', '*' ); el.contentWindow.postMessage( '{"method":"play"}', '*' );
} }
}); });