Added isFirstSlide and isLastSlide functions

This commit is contained in:
Gourav Tiwari 2013-02-11 13:51:40 -05:00
parent 7ee4e0ba66
commit 4df8a25625

View 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 = {};