소스 검색

debounce messages from notes -> main window, fixes #3147

hakimel 3 년 전
부모
커밋
2a239aedca
8개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 0 0
      dist/reveal.esm.js
  2. 0 0
      dist/reveal.esm.js.map
  3. 0 0
      dist/reveal.js
  4. 0 0
      dist/reveal.js.map
  5. 1 1
      js/controllers/location.js
  6. 0 0
      plugin/notes/notes.esm.js
  7. 0 0
      plugin/notes/notes.js
  8. 9 1
      plugin/notes/speaker-view.html

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/reveal.esm.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/reveal.esm.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/reveal.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/reveal.js.map


+ 1 - 1
js/controllers/location.js

@@ -5,7 +5,7 @@ export default class Location {
 
 	// The minimum number of milliseconds that must pass between
 	// calls to history.replaceState
-	MAX_REPLACE_STATE_FREQUENCY = 250
+	MAX_REPLACE_STATE_FREQUENCY = 1000
 
 	constructor( Reveal ) {
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
plugin/notes/notes.esm.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
plugin/notes/notes.js


+ 9 - 1
plugin/notes/speaker-view.html

@@ -403,13 +403,21 @@
 						}
 						else if( /slidechanged|fragmentshown|fragmenthidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
 
-							window.opener.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ]} ), '*' );
+							dispatchStateToMainWindow( data.state );
 
 						}
 					}
 
 				} );
 
+				/**
+				 * Updates the presentation in the main window to match the state
+				 * of the presentation in the notes window.
+				 */
+				const dispatchStateToMainWindow = debounce(( state ) => {
+					window.opener.postMessage( JSON.stringify({ method: 'setState', args: [ state ]} ), '*' );
+				}, 500);
+
 				/**
 				 * Asynchronously calls the Reveal.js API of the main frame.
 				 */

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.