diff --git a/js/reveal.js b/js/reveal.js index a49493c..75e88e4 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -85,6 +85,10 @@ // i.e. contained within a limited portion of the screen embedded: false, + // Flags if we should show a help overlay when the questionmark + // key is pressed + help: true, + // Number of milliseconds between automatically proceeding to the // next slide, disabled when set to 0, this value can be overwritten // by using a data-autoslide attribute on your slides @@ -1278,39 +1282,43 @@ */ function showHelp() { - closeOverlay(); + if( config.help ) { - dom.overlay = document.createElement( 'div' ); - dom.overlay.classList.add( 'overlay' ); - dom.overlay.classList.add( 'overlay-help' ); - dom.wrapper.appendChild( dom.overlay ); - - var html = '

Keyboard Shortcuts


'; - - html += ''; - for( var key in keyboardShortcuts ) { - html += ''; - } - - html += '
KEYACTION
' + key + '' + keyboardShortcuts[ key ] + '
'; - - dom.overlay.innerHTML = [ - '
', - '', - '
', - '
', - '
'+ html +'
', - '
' - ].join(''); - - dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { closeOverlay(); - event.preventDefault(); - }, false ); - setTimeout( function() { - dom.overlay.classList.add( 'visible' ); - }, 1 ); + dom.overlay = document.createElement( 'div' ); + dom.overlay.classList.add( 'overlay' ); + dom.overlay.classList.add( 'overlay-help' ); + dom.wrapper.appendChild( dom.overlay ); + + var html = '

Keyboard Shortcuts


'; + + html += ''; + for( var key in keyboardShortcuts ) { + html += ''; + } + + html += '
KEYACTION
' + key + '' + keyboardShortcuts[ key ] + '
'; + + dom.overlay.innerHTML = [ + '
', + '', + '
', + '
', + '
'+ html +'
', + '
' + ].join(''); + + dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { + closeOverlay(); + event.preventDefault(); + }, false ); + + setTimeout( function() { + dom.overlay.classList.add( 'visible' ); + }, 1 ); + + } }