Commit 3677e82a authored by Aral Balkan's avatar Aral Balkan

Start the presentation timer on first key press

(So that it starts when the presentation does, not before.)
parent 279846e2
......@@ -144,7 +144,7 @@
.speaker-controls-time .clock {
/* float: right;*/
text-align: center;
color: white;
color: #ccc;
}
.speaker-controls-time span.mute {
......@@ -394,7 +394,6 @@
setupIframes( data );
setupKeyboard();
setupNotes();
setupTimer();
}
}
......@@ -433,6 +432,9 @@
// Limit to max one state update per X ms
handleStateMessage = debounce( handleStateMessage, 200 );
// Start counter on first key press.
var presentationStarted = false
/**
* Forward keyboard events to the current slide window.
* This enables keyboard events to work even if focus
......@@ -441,6 +443,12 @@
function setupKeyboard() {
document.addEventListener( 'keydown', function( event ) {
if (!presentationStarted) {
presentationStarted = true
setupTimer();
}
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' );
} );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment