Skip to content

Commit

Permalink
Merge pull request #3716 from gpotter2/controls-for-speaker
Browse files Browse the repository at this point in the history
Add 'controlsOnlyForSpeaker' option
  • Loading branch information
hakimel authored Jan 13, 2025
2 parents e15cf92 + 3751715 commit 6527f4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion js/controllers/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 6527f4d

Please sign in to comment.