aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2017-11-29 09:38:05 +0100
committerHakim El Hattab <hakim.elhattab@gmail.com>2017-11-29 09:38:05 +0100
commit60288444521bd7cfd0943e943e4ac464f6254ab9 (patch)
tree668745d48d49d0edc12a88b9642774390ad6525a /plugin
parenta0a9aa78219ad54c1a8be2c478b91bc4ccfa36c1 (diff)
parentb86b667d2552b32dd0a6d52a210fcf6bbb132867 (diff)
downloadperl-software-in-gnu-guix-60288444521bd7cfd0943e943e4ac464f6254ab9.tar
perl-software-in-gnu-guix-60288444521bd7cfd0943e943e4ac464f6254ab9.tar.gz
Merge branch 'plugin-key-bindings' of https://github.com/denehyg/reveal.js into dev
Diffstat (limited to 'plugin')
-rw-r--r--plugin/notes/notes.js19
1 files changed, 3 insertions, 16 deletions
diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js
index 80fb6e2..3f00eb6 100644
--- a/plugin/notes/notes.js
+++ b/plugin/notes/notes.js
@@ -131,22 +131,9 @@ var RevealNotes = (function() {
}
// Open the notes when the 's' key is hit
- document.addEventListener( 'keydown', function( event ) {
- // Disregard the event if the target is editable or a
- // modifier is present
- if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
-
- // Disregard the event if keyboard is disabled
- if ( Reveal.getConfig().keyboard === false ) return;
-
- if( event.keyCode === 83 ) {
- event.preventDefault();
- openNotes();
- }
- }, false );
-
- // Show our keyboard shortcut in the reveal.js help overlay
- if( window.Reveal ) Reveal.registerKeyboardShortcut( 'S', 'Speaker notes view' );
+ Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() {
+ openNotes();
+ } );
}