浏览代码

dont toggle paused/overview modes needlessly when setting state

Hakim El Hattab 11 年之前
父节点
当前提交
ce05138f9a
共有 3 个文件被更改,包括 20 次插入7 次删除
  1. 11 4
      js/reveal.js
  2. 8 2
      plugin/notes/notes.html
  3. 1 1
      plugin/notes/notes.js

+ 11 - 4
js/reveal.js

@@ -968,8 +968,6 @@ var Reveal = (function(){
 	 */
 	function dispatchEvent( type, args ) {
 
-		console.log('event', type);
-
 		var event = document.createEvent( 'HTMLEvents', 1, 2 );
 		event.initEvent( type, true, true );
 		extend( event, args );
@@ -2498,8 +2496,17 @@ var Reveal = (function(){
 
 		if( typeof state === 'object' ) {
 			slide( deserialize( state.indexh ), deserialize( state.indexv ), deserialize( state.indexf ) );
-			togglePause( deserialize( state.paused ) );
-			toggleOverview( deserialize( state.overview ) );
+
+			var pausedFlag = deserialize( state.paused ),
+				overviewFlag = deserialize( state.overview );
+
+			if( typeof pausedFlag === 'boolean' && pausedFlag !== isPaused() ) {
+				togglePause( pausedFlag );
+			}
+
+			if( typeof overviewFlag === 'boolean' && overviewFlag !== isOverview() ) {
+				toggleOverview( overviewFlag );
+			}
 		}
 
 	}

+ 8 - 2
plugin/notes/notes.html

@@ -249,7 +249,13 @@
 				 */
 				function setupIframes( data ) {
 
-					var url = data.url + '?receiver&progress=false&overview=false&history=false';
+					var params = [
+						'receiver',
+						'progress=false',
+						'history=false'
+					];
+
+					var url = data.url + '?' + params.join( '&' );
 					var hash = '#/' + data.state.indexh + '/' + data.state.indexv;
 
 					currentSlide = document.createElement( 'iframe' );
@@ -261,7 +267,7 @@
 					nextSlide = document.createElement( 'iframe' );
 					nextSlide.setAttribute( 'width', 640 );
 					nextSlide.setAttribute( 'height', 512 );
-					nextSlide.setAttribute( 'src', url + '&controls=false' + hash );
+					nextSlide.setAttribute( 'src', url + '&controls=false&transition=none&backgroundTransition=none' + hash );
 					document.querySelector( '#next-slide' ).appendChild( nextSlide );
 
 				}

+ 1 - 1
plugin/notes/notes.js

@@ -14,7 +14,7 @@ var RevealNotes = (function() {
 	function openNotes() {
 		var jsFileLocation = document.querySelector('script[src$="notes.js"]').src;  // this js file path
 		jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, '');   // the js folder path
-		var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' );
+		var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1100,height=700' );
 
 		/**
 		 * Connect to the notes window through a postmessage handshake.