From 37517154144b651522f95669781942a807a93818 Mon Sep 17 00:00:00 2001 From: gpotter2 <10530980+gpotter2@users.noreply.github.com> Date: Sat, 11 Jan 2025 16:41:06 +0100 Subject: [PATCH] Add controls: 'speaker-only' option --- js/config.js | 4 +++- js/controllers/controls.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/config.js b/js/config.js index de44bd60491..e5c4bd25674 100644 --- a/js/config.js +++ b/js/config.js @@ -15,7 +15,9 @@ export default { minScale: 0.2, maxScale: 2.0, - // Display presentation control arrows + // Display presentation control arrows. + // This can be a boolean (true / false) or 'speaker-only' to only display + // the controls on the speaker's screen. controls: true, // Help the user learn the controls by providing hints, for example by diff --git a/js/controllers/controls.js b/js/controllers/controls.js index 1ab60d0c77c..7c52a0fcbbf 100644 --- a/js/controllers/controls.js +++ b/js/controllers/controls.js @@ -66,7 +66,10 @@ export default class Controls { */ configure( config, oldConfig ) { - this.element.style.display = config.controls ? 'block' : 'none'; + this.element.style.display = ( + config.controls && + (config.controls !== 'speaker-only' || this.Reveal.isSpeakerNotes()) + ) ? 'block' : 'none'; this.element.setAttribute( 'data-controls-layout', config.controlsLayout ); this.element.setAttribute( 'data-controls-back-arrows', config.controlsBackArrows );