From f0b93d895b519d00e60438f41fdf9fbf453a8f95 Mon Sep 17 00:00:00 2001 From: andy matthews Date: Thu, 31 Jan 2013 16:44:15 -0600 Subject: [PATCH] Only allowing 'unpause' keyboard events while paused --- js/reveal.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 542edc2..fd8a9f0 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -563,7 +563,7 @@ var Reveal = (function(){ continue; } - // Vertical stacks are not centered since their section + // Vertical stacks are not centered since their section // children will be if( slide.classList.contains( 'stack' ) ) { slide.style.top = 0; @@ -594,7 +594,7 @@ var Reveal = (function(){ } /** - * Retrieves the vertical index which was stored using + * Retrieves the vertical index which was stored using * #setPreviousVerticalIndex() or 0 if no previous index * exists. * @@ -1066,7 +1066,7 @@ var Reveal = (function(){ var slideAutoSlide = slides[index].getAttribute( 'data-autoslide' ); if( slideAutoSlide ) { autoSlide = parseInt( slideAutoSlide, 10 ); - } + } else { autoSlide = config.autoSlide; } @@ -1480,6 +1480,11 @@ var Reveal = (function(){ var triggered = true; + // while paused only allow "unpausing" keyboard events (b and .) + if (isPaused() && [66,190,191].indexOf(event.keyCode) === -1 ) { + return false; + } + switch( event.keyCode ) { // p, page up case 80: case 33: navigatePrev(); break;