Commit 4022cbfe authored by Hakim El Hattab's avatar Hakim El Hattab
Browse files

simplify logic for finding slide backgrounds

parent 28d6a777
......@@ -3869,25 +3869,12 @@
*/
function getSlideBackground( x, y ) {
// When printing to PDF the slide backgrounds are nested
// inside of the slides
if( isPrintingPDF() ) {
var slide = getSlide( x, y );
if( slide ) {
return slide.slideBackgroundElement;
}
return undefined;
}
var horizontalBackground = dom.wrapper.querySelectorAll( '.backgrounds>.slide-background' )[ x ];
var verticalBackgrounds = horizontalBackground && horizontalBackground.querySelectorAll( '.slide-background' );
if( verticalBackgrounds && verticalBackgrounds.length && typeof y === 'number' ) {
return verticalBackgrounds ? verticalBackgrounds[ y ] : undefined;
var slide = getSlide( x, y );
if( slide ) {
return slide.slideBackgroundElement;
}
return horizontalBackground;
return undefined;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment