diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-06-16 18:46:38 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-06-16 18:46:38 +0200 |
commit | ebfb49674308e51b1089e0451afc74d678482a09 (patch) | |
tree | 8b6f546b046bd970c6eb9c0c08dd94d475405c34 /js/reveal.js | |
parent | 2e0fe815a65f7431a51812bbf695b2fbda0927c8 (diff) | |
download | fosdem-2018-presentation-ebfb49674308e51b1089e0451afc74d678482a09.tar fosdem-2018-presentation-ebfb49674308e51b1089e0451afc74d678482a09.tar.gz |
config option for disabling the help overlay
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 60 |
1 files changed, 34 insertions, 26 deletions
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 ); + closeOverlay(); - var html = '<p class="title">Keyboard Shortcuts</p><br/>'; + dom.overlay = document.createElement( 'div' ); + dom.overlay.classList.add( 'overlay' ); + dom.overlay.classList.add( 'overlay-help' ); + dom.wrapper.appendChild( dom.overlay ); - html += '<table><th>KEY</th><th>ACTION</th>'; - for( var key in keyboardShortcuts ) { - html += '<tr><td>' + key + '</td><td>' + keyboardShortcuts[ key ] + '</td></tr>'; - } + var html = '<p class="title">Keyboard Shortcuts</p><br/>'; - html += '</table>'; + html += '<table><th>KEY</th><th>ACTION</th>'; + for( var key in keyboardShortcuts ) { + html += '<tr><td>' + key + '</td><td>' + keyboardShortcuts[ key ] + '</td></tr>'; + } - dom.overlay.innerHTML = [ - '<header>', - '<a class="close" href="#"><span class="icon"></span></a>', - '</header>', - '<div class="viewport">', - '<div class="viewport-inner">'+ html +'</div>', - '</div>' - ].join(''); + html += '</table>'; - dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { - closeOverlay(); - event.preventDefault(); - }, false ); + dom.overlay.innerHTML = [ + '<header>', + '<a class="close" href="#"><span class="icon"></span></a>', + '</header>', + '<div class="viewport">', + '<div class="viewport-inner">'+ html +'</div>', + '</div>' + ].join(''); - setTimeout( function() { - dom.overlay.classList.add( 'visible' ); - }, 1 ); + dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { + closeOverlay(); + event.preventDefault(); + }, false ); + + setTimeout( function() { + dom.overlay.classList.add( 'visible' ); + }, 1 ); + + } } |