aboutsummaryrefslogtreecommitdiff
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-04-13 11:55:06 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-04-13 11:55:06 +0200
commit3b111a1cd4cd8fe4a7bd27f70ea270e09a0073ce (patch)
treed17a1109750d6a89430290ffaceed6792b3f412a /js/reveal.js
parent731598f7c8fdb2b5fa6ade3f3e351958a5ba1a28 (diff)
downloadfreenode-live-2017-presentation-3b111a1cd4cd8fe4a7bd27f70ea270e09a0073ce.tar
freenode-live-2017-presentation-3b111a1cd4cd8fe4a7bd27f70ea270e09a0073ce.tar.gz
add support for custom keyboard availability condition
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 962a7cd..fe499ea 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -44,6 +44,9 @@ var Reveal = (function(){
// Enable keyboard shortcuts for navigation
keyboard: true,
+ // Optional function that blocks keyboard events when retuning false
+ keyboardCondition: null,
+
// Enable the slide overview mode
overview: true,
@@ -2836,6 +2839,12 @@ var Reveal = (function(){
*/
function onDocumentKeyDown( event ) {
+ // If there's a condition specified and it returns false,
+ // ignore this event
+ if( typeof config.keyboardCondition === 'function' && config.keyboardCondition() === false ) {
+ return true;
+ }
+
// Remember if auto-sliding was paused so we can toggle it
var autoSlideWasPaused = autoSlidePaused;