aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-04-27 15:04:37 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-04-27 15:04:37 +0200
commitc58096ea991771425f61b9a3a6fc0de8abab07d6 (patch)
treeca3230ad5f2d0c1b503bc6f9ded008dc366dfb7a
parent902e36c0228478083d9f2ef487c12f9de401d404 (diff)
downloadfreenode-live-2017-presentation-c58096ea991771425f61b9a3a6fc0de8abab07d6.tar
freenode-live-2017-presentation-c58096ea991771425f61b9a3a6fc0de8abab07d6.tar.gz
disregard v index when there is no vertical slides/backgrounds in getSlide/getSlideBackground
-rw-r--r--js/reveal.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 2c87c87..d0c8272 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2645,12 +2645,15 @@ var Reveal = (function(){
}
+ /**
+ * Returns the slide element matching the specified index.
+ */
function getSlide( x, y ) {
var horizontalSlide = document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR )[ x ];
var verticalSlides = horizontalSlide && horizontalSlide.querySelectorAll( 'section' );
- if( typeof y === 'number' ) {
+ if( verticalSlides && verticalSlides.length && typeof y === 'number' ) {
return verticalSlides ? verticalSlides[ y ] : undefined;
}
@@ -2669,7 +2672,7 @@ var Reveal = (function(){
var horizontalBackground = document.querySelectorAll( '.backgrounds>.slide-background' )[ x ];
var verticalBackgrounds = horizontalBackground && horizontalBackground.querySelectorAll( '.slide-background' );
- if( typeof y === 'number' ) {
+ if( verticalBackgrounds && verticalBackgrounds.length && typeof y === 'number' ) {
return verticalBackgrounds ? verticalBackgrounds[ y ] : undefined;
}