diff options
author | Hakim El Hattab | 2017-11-29 09:46:45 +0100 |
---|---|---|
committer | Hakim El Hattab | 2017-11-29 09:46:45 +0100 |
commit | c966c118fa34394b480b14273233c4d874388cbe (patch) | |
tree | 2046802e4ea3f2e2df02ba5a0d1fe1eab1c189b5 | |
parent | 60288444521bd7cfd0943e943e4ac464f6254ab9 (diff) |
minor formatting tweaks
-rw-r--r-- | js/reveal.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/js/reveal.js b/js/reveal.js index 021c8d9..b1dd5fa 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1265,10 +1265,12 @@ } /** - * Add a custom key binding with optional description to be added to the help screen + * Add a custom key binding with optional description to + * be added to the help screen. */ - function addKeyBinding(binding, callback) { - if (typeof binding === 'object' && binding.keyCode) { + function addKeyBinding( binding, callback ) { + + if( typeof binding === 'object' && binding.keyCode ) { registeredKeyBindings[binding.keyCode] = { callback: callback, key: binding.key, @@ -1282,13 +1284,16 @@ description: null }; } + } /** - * Removes the specified custom key binding + * Removes the specified custom key binding. */ - function removeKeyBinding(binding) { - delete registeredKeyBindings[binding]; + function removeKeyBinding( keyCode ) { + + delete registeredKeyBindings[keyCode]; + } /** @@ -1778,9 +1783,9 @@ html += '<tr><td>' + key + '</td><td>' + keyboardShortcuts[ key ] + '</td></tr>'; } - // add custom key bindings that have associated descriptions + // Add custom key bindings that have associated descriptions for( var binding in registeredKeyBindings ) { - if (registeredKeyBindings[binding].key && registeredKeyBindings[binding].description) { + if( registeredKeyBindings[binding].key && registeredKeyBindings[binding].description ) { html += '<tr><td>' + registeredKeyBindings[binding].key + '</td><td>' + registeredKeyBindings[binding].description + '</td></tr>'; } } |