Преглед на файлове

Block F5 in speaker notes window, avoid disconnects

Thomas Weinert преди 7 години
родител
ревизия
c0109d948f
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      plugin/notes/notes.html

+ 6 - 0
plugin/notes/notes.html

@@ -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 ] }), '*' );
 					} );