Merge pull request #2215 from anderslemke/let-resume-follow-controls

Only show resume on pause if controls enabled
This commit is contained in:
Hakim El Hattab 2018-08-16 11:46:46 +02:00 committed by GitHub
commit b003a54f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -593,8 +593,7 @@
dom.speakerNotes.setAttribute( 'tabindex', '0' ); dom.speakerNotes.setAttribute( 'tabindex', '0' );
// Overlay graphic which is displayed during the paused mode // Overlay graphic which is displayed during the paused mode
dom.pauseOverlay = createSingletonNode( dom.wrapper, 'div', 'pause-overlay', '<button class="resume-button">Resume presentation</button>' ); dom.pauseOverlay = createSingletonNode( dom.wrapper, 'div', 'pause-overlay', config.controls ? '<button class="resume-button">Resume presentation</button>' : null );
dom.resumeButton = dom.pauseOverlay.querySelector( '.resume-button' );
dom.wrapper.setAttribute( 'role', 'application' ); dom.wrapper.setAttribute( 'role', 'application' );
@ -1299,7 +1298,7 @@
dom.progress.addEventListener( 'click', onProgressClicked, false ); dom.progress.addEventListener( 'click', onProgressClicked, false );
} }
dom.resumeButton.addEventListener( 'click', resume, false ); dom.pauseOverlay.addEventListener( 'click', resume, false );
if( config.focusBodyOnPageVisibilityChange ) { if( config.focusBodyOnPageVisibilityChange ) {
var visibilityChange; var visibilityChange;
@ -1364,7 +1363,7 @@
dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false ); dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );
dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false ); dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );
dom.resumeButton.removeEventListener( 'click', resume, false ); dom.pauseOverlay.removeEventListener( 'click', resume, false );
if ( config.progress && dom.progress ) { if ( config.progress && dom.progress ) {
dom.progress.removeEventListener( 'click', onProgressClicked, false ); dom.progress.removeEventListener( 'click', onProgressClicked, false );