aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2017-02-09 11:31:00 +0100
committerGitHub <noreply@github.com>2017-02-09 11:31:00 +0100
commit1749f0d019c4460e13530db19882079c4ec0a124 (patch)
tree1e0a75109bbdd6bca24a0b701c7d913b5fc26c70
parentadc326139a51079c2b8908a13f5d6a474ca4ee9f (diff)
parent2a1303f3c1861d12ff27f401c0f5d421f7c5133b (diff)
downloadfosdem-2018-presentation-1749f0d019c4460e13530db19882079c4ec0a124.tar
fosdem-2018-presentation-1749f0d019c4460e13530db19882079c4ec0a124.tar.gz
Merge pull request #1816 from Frazer/patch-1
added toggleHelp function
-rw-r--r--js/reveal.js31
1 files changed, 25 insertions, 6 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 4502919..a5783e0 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -1634,6 +1634,29 @@
}
/**
+ * Open or close help overlay window.
+ *
+ * @param {Boolean} [override] Flag which overrides the
+ * toggle logic and forcibly sets the desired state. True means
+ * help is open, false means it's closed.
+ */
+ function toggleHelp( override ){
+
+ if( typeof override === 'boolean' ) {
+ override ? showHelp( true ) : closeOverlay();
+ }
+ else {
+ if( dom.overlay ) {
+ closeOverlay();
+ }
+ else {
+ showHelp( true );
+ }
+ }
+ }
+
+
+ /**
* Opens an overlay window with help material.
*/
function showHelp() {
@@ -4157,12 +4180,7 @@
// Check if the pressed key is question mark
if( event.shiftKey && event.charCode === 63 ) {
- if( dom.overlay ) {
- closeOverlay();
- }
- else {
- showHelp( true );
- }
+ toggleHelp();
}
}
@@ -4862,6 +4880,7 @@
// Shows a help overlay with keyboard shortcuts
showHelp: showHelp,
+ toggleHelp: toggleHelp,
// Forces an update in slide layout
layout: layout,