Skip to content
Snippets Groups Projects
Commit c0109d94 authored by Thomas Weinert's avatar Thomas Weinert
Browse files

Block F5 in speaker notes window, avoid disconnects

parent bfd431a0
No related branches found
No related tags found
No related merge requests found
......@@ -427,10 +427,16 @@
* Forward keyboard events to the current slide window.
* This enables keyboard events to work even if focus
* isn't set on the current slide iframe.
*
* Block F5 default handling, it reloads and disconnects
* the speaker notes window.
*/
function setupKeyboard() {
document.addEventListener( 'keydown', function( event ) {
if (event.keyCode === 116) {
event.preventDefault();
}
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' );
} );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment