aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-04-27 17:31:50 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-04-27 17:31:50 +0200
commit860580d4d0d10646b59a9b3663c0c1cc504bc1c2 (patch)
treee8aaa5ab5d02a7857038c0eacf80890e55103f5f /js
parent41e1e013b8c86683fd042e65bc3fc0f4e1655559 (diff)
downloadfreenode-live-2017-presentation-860580d4d0d10646b59a9b3663c0c1cc504bc1c2.tar
freenode-live-2017-presentation-860580d4d0d10646b59a9b3663c0c1cc504bc1c2.tar.gz
getSlideBackground now works in pdf mode, add pdf tests
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index a4dba10..d1f2fb0 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2693,11 +2693,18 @@ var Reveal = (function(){
/**
* Returns the background element for the given slide.
* All slides, even the ones with no background properties
- * defined, have a background element so this never returns
- * null.
+ * defined, have a background element so as long as the
+ * index is valid an element will be returned.
*/
function getSlideBackground( x, y ) {
+ // When printing to PDF the slide backgrounds are nested
+ // inside of the slides
+ if( isPrintingPDF() ) {
+ var slide = getSlide( x, y );
+ return slide ? slide.querySelector( '.slide-background' ) : undefined;
+ }
+
var horizontalBackground = document.querySelectorAll( '.backgrounds>.slide-background' )[ x ];
var verticalBackgrounds = horizontalBackground && horizontalBackground.querySelectorAll( '.slide-background' );