From: Gourav Tiwari Date: Mon, 11 Feb 2013 18:51:40 +0000 (-0500) Subject: Added isFirstSlide and isLastSlide functions X-Git-Tag: 2.3.0~53^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4df8a256254705b6c6ffa5cf2edb7c52d26b43ec;p=reveal.js.git Added isFirstSlide and isLastSlide functions --- diff --git a/js/reveal.js b/js/reveal.js index fc5164d..0c39f8e 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1529,7 +1529,25 @@ var Reveal = (function(){ } + /** + * + * @return {Boolean} true if current slide is first slide, + * false otherwise + */ + + function firstSlide(){ + return (document.querySelector(SLIDES_SELECTOR + '.past') == null ? true : false); + } + + /** + * + * @return {Boolean} true if current slide is last slide, + * false otherwise + */ + function lastSlide(){ + return (document.querySelector(SLIDES_SELECTOR + '.future') == null ? true : false); + } // --------------------------------------------------------------------// // ----------------------------- EVENTS -------------------------------// // --------------------------------------------------------------------// @@ -1880,6 +1898,14 @@ var Reveal = (function(){ return scale; }, + isFirstSlide: function(){ + return firstSlide(); + }, + + isLastSlide: function(){ + return lastSlide(); + }, + // Helper method, retrieves query string as a key/value hash getQueryHash: function() { var query = {};