Browse Source

add getTotalSlides #858

Hakim El Hattab 11 years ago
parent
commit
9947b7a532
2 changed files with 12 additions and 1 deletions
  1. 11 0
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 11 - 0
js/reveal.js

@@ -2392,6 +2392,15 @@ var Reveal = (function(){
 
 	}
 
+	/**
+	 * Retrieves the total number of slides in this presentation.
+	 */
+	function getTotalSlides() {
+
+		return document.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ).length;
+
+	}
+
 	/**
 	 * Retrieves the current state of the presentation as
 	 * an object. This state can then be restored at any
@@ -3457,6 +3466,8 @@ var Reveal = (function(){
 		// Returns the indices of the current, or specified, slide
 		getIndices: getIndices,
 
+		getTotalSlides: getTotalSlides,
+
 		// Returns the slide at the specified index, y is optional
 		getSlide: function( x, y ) {
 			var horizontalSlide = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR )[ x ];

File diff suppressed because it is too large
+ 1 - 1
js/reveal.min.js


Some files were not shown because too many files changed in this diff