소스 검색

Merge branch 'issue_2041' of https://github.com/denehyg/reveal.js into dev

Hakim El Hattab 7 년 전
부모
커밋
1f1f86ec73
1개의 변경된 파일11개의 추가작업 그리고 10개의 파일을 삭제
  1. 11 10
      js/reveal.js

+ 11 - 10
js/reveal.js

@@ -2453,16 +2453,7 @@
 
 		// Dispatch an event if the slide changed
 		var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore );
-		if( slideChanged ) {
-			dispatchEvent( 'slidechanged', {
-				'indexh': indexh,
-				'indexv': indexv,
-				'previousSlide': previousSlide,
-				'currentSlide': currentSlide,
-				'origin': o
-			} );
-		}
-		else {
+		if (!slideChanged) {
 			// Ensure that the previous slide is never the same as the current
 			previousSlide = null;
 		}
@@ -2490,6 +2481,16 @@
 			}
 		}
 
+		if( slideChanged ) {
+			dispatchEvent( 'slidechanged', {
+				'indexh': indexh,
+				'indexv': indexv,
+				'previousSlide': previousSlide,
+				'currentSlide': currentSlide,
+				'origin': o
+			} );
+		}
+
 		// Handle embedded content
 		if( slideChanged || !previousSlide ) {
 			stopEmbeddedContent( previousSlide );