Przeglądaj źródła

fix bug where isLastSlide sometimes incorrectly returned false

Hakim El Hattab 10 lat temu
rodzic
commit
f61ee9a693
2 zmienionych plików z 11 dodań i 6 usunięć
  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

Plik diff jest za duży
+ 1 - 1
js/reveal.min.js


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików