Skip to content

Commit

Permalink
add getTotalSlides #858
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Apr 1, 2014
1 parent 1de159c commit 9947b7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ];
Expand Down
Loading

0 comments on commit 9947b7a

Please # to comment.