Added isFirstSlide and isLastSlide functions
authorGourav Tiwari <gouravtiwari21@gmail.com>
Mon, 11 Feb 2013 18:51:40 +0000 (13:51 -0500)
committerGourav Tiwari <gouravtiwari21@gmail.com>
Mon, 11 Feb 2013 18:51:40 +0000 (13:51 -0500)
js/reveal.js

index fc5164df5f10bc64989b5750ea8d25fc1cc5ef79..0c39f8ed1302106544cefde1d74f38b36cd90e35 100644 (file)
@@ -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 = {};