fix: links not working when controls are disabled

This commit is contained in:
Thomas Geier 2013-09-03 11:10:05 +02:00
parent d62093c228
commit 8a468394b5
1 changed files with 58 additions and 70 deletions

View File

@ -353,7 +353,6 @@ var Reveal = (function(){
createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null );
// Cache references to elements
if ( config.controls ) {
dom.controls = document.querySelector( '.reveal .controls' );
// There can be multiple instances of controls throughout the page
@ -363,7 +362,6 @@ var Reveal = (function(){
dom.controlsDown = toArray( document.querySelectorAll( '.navigate-down' ) );
dom.controlsPrev = toArray( document.querySelectorAll( '.navigate-prev' ) );
dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) );
}
}
@ -491,9 +489,7 @@ var Reveal = (function(){
dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed );
dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition );
if( dom.controls ) {
dom.controls.style.display = ( config.controls && dom.controls ) ? 'block' : 'none';
}
if( dom.progress ) {
dom.progress.style.display = ( config.progress && dom.progress ) ? 'block' : 'none';
@ -586,7 +582,6 @@ var Reveal = (function(){
dom.progress.addEventListener( 'click', onProgressClicked, false );
}
if ( config.controls && dom.controls ) {
[ '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 ); } );
@ -595,7 +590,6 @@ var Reveal = (function(){
dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } );
dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } );
} );
}
}
@ -624,7 +618,6 @@ var Reveal = (function(){
dom.progress.removeEventListener( 'click', onProgressClicked, false );
}
if ( config.controls && dom.controls ) {
[ 'touchstart', 'click' ].forEach( function( eventName ) {
dom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );
dom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );
@ -633,7 +626,6 @@ var Reveal = (function(){
dom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );
dom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );
} );
}
}
@ -1792,8 +1784,6 @@ var Reveal = (function(){
*/
function updateControls() {
if ( config.controls && dom.controls ) {
var routes = availableRoutes();
var fragments = availableFragments();
@ -1838,8 +1828,6 @@ var Reveal = (function(){
}
}
/**
* Updates the background elements to reflect the current
* slide.