aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJason Kiss <jason@accessibleculture.org>2016-05-10 11:02:45 +1200
committerJason Kiss <jason@accessibleculture.org>2016-05-10 11:02:45 +1200
commitdec6d1745b780e67960afe20a5a0d86f23ba0733 (patch)
tree2eaacd30e82164aa875b4de7c6141264f3d654d9 /js
parent3d49b1dea362d3d05ae154d36927121d922207ad (diff)
downloadfosdem-2018-presentation-dec6d1745b780e67960afe20a5a0d86f23ba0733.tar
fosdem-2018-presentation-dec6d1745b780e67960afe20a5a0d86f23ba0733.tar.gz
make speaker notes keyboard accessible
Places div.speaker-notes in default kbd Tab order, and when focused, prevent slide navigation with up/down arrows, allowing up/down arrow keys to scroll div.speaker-notes.
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 10c609e..3ff1f85 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -495,6 +495,7 @@
// Element containing notes that are visible to the audience
dom.speakerNotes = createSingletonNode( dom.wrapper, 'div', 'speaker-notes', null );
dom.speakerNotes.setAttribute( 'data-prevent-swipe', '' );
+ dom.speakerNotes.setAttribute( 'tabindex', '0');
// Overlay graphic which is displayed during the paused mode
createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null );
@@ -3963,10 +3964,11 @@
// the keyboard
var activeElementIsCE = document.activeElement && document.activeElement.contentEditable !== 'inherit';
var activeElementIsInput = document.activeElement && document.activeElement.tagName && /input|textarea/i.test( document.activeElement.tagName );
+ var activeElementIsNotes = document.activeElement && document.activeElement.className && /speaker-notes/i.test( document.activeElement.className);
// Disregard the event if there's a focused element or a
// keyboard modifier key is present
- if( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
+ if( activeElementIsCE || activeElementIsInput || activeElementIsNotes || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
// While paused only allow resume keyboard events; 'b', '.''
var resumeKeyCodes = [66,190,191];