diff options
author | Adam Spiers <github@adamspiers.org> | 2016-04-16 15:12:22 +0100 |
---|---|---|
committer | Adam Spiers <github@adamspiers.org> | 2017-04-20 15:18:15 +0100 |
commit | ef9cbbbbb92560f1ffd41dce23a584474922fe16 (patch) | |
tree | fbe6d5508cd47c314ab6e5de00d91693cabc122f /js | |
parent | 40912ace1f3597adadb42a8b4a30b8721fc9b6df (diff) | |
download | perl-software-in-gnu-guix-ef9cbbbbb92560f1ffd41dce23a584474922fe16.tar perl-software-in-gnu-guix-ef9cbbbbb92560f1ffd41dce23a584474922fe16.tar.gz |
add new getSlides() API
This can be used by plugins which are concerned with helping the
presenter with their pace.
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/js/reveal.js b/js/reveal.js index 2856f00..1f288b9 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3674,13 +3674,22 @@ } /** + * Retrieves all slides in this presentation. + */ + function getSlides() { + + return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' )); + + } + + /** * Retrieves the total number of slides in this presentation. * * @return {number} */ function getTotalSlides() { - return dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ).length; + return getSlides().length; } @@ -4984,6 +4993,9 @@ // Returns the indices of the current, or specified, slide getIndices: getIndices, + // Returns an Array of all slides + getSlides: getSlides, + // Returns the total number of slides getTotalSlides: getTotalSlides, |