소스 검색

fix bug where isLastSlide sometimes incorrectly returned false

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

+ 10 - 5
js/reveal.js

@@ -2759,12 +2759,17 @@ var Reveal = (function(){
 
 		// Returns true if we're currently on the last slide
 		isLastSlide: function() {
-			if( currentSlide && currentSlide.classList.contains( '.stack' ) ) {
-				return currentSlide.querySelector( SLIDES_SELECTOR + '.future' ) == null ? true : false;
-			}
-			else {
-				return document.querySelector( SLIDES_SELECTOR + '.future' ) == null ? true : false;
+			if( currentSlide ) {
+				// Does this slide has next a sibling?
+				if( currentSlide.nextElementSibling ) return false;
+
+				// If it's vertical, does its parent have a next sibling?
+				if( isVerticalSlide( currentSlide ) && currentSlide.parentNode.nextElementSibling ) return false;
+
+				return true;
 			}
+
+			return false;
 		},
 
 		// Checks if reveal.js has been loaded and is ready for use

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


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