From 2a1303f3c1861d12ff27f401c0f5d421f7c5133b Mon Sep 17 00:00:00 2001
From: Frazer Kirkman <frazer@unitedvisions.org>
Date: Tue, 7 Feb 2017 19:53:58 +0100
Subject: [PATCH] added override parameter to toggleHelp function

---
 js/reveal.js | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/js/reveal.js b/js/reveal.js
index 290097f..2e4e978 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -1630,15 +1630,26 @@
 
 	/**
 	 * 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(){
-		if( dom.overlay ) {
-			closeOverlay();
+	function toggleHelp( override ){
+		
+		if( typeof override === 'boolean' ) {
+			override ? showHelp( true ) : closeOverlay();
 		}
-		else {
-			showHelp( true );
+		else {		
+			if( dom.overlay ) {
+				closeOverlay();
+			}
+			else {
+				showHelp( true );
+			}
 		}
 	}
+
 	
 	/**
 	 * Opens an overlay window with help material.