|
@@ -1,4 +1,4 @@
|
|
-import { HORIZONTAL_SLIDES_SELECTOR } from '../utils/constants.js'
|
|
|
|
|
|
+import { HORIZONTAL_SLIDES_SELECTOR, SLIDES_BACKGROUNDS_SELECTOR } from '../utils/constants.js'
|
|
import { queryAll } from '../utils/util.js'
|
|
import { queryAll } from '../utils/util.js'
|
|
|
|
|
|
const HIDE_SCROLLBAR_TIMEOUT = 500;
|
|
const HIDE_SCROLLBAR_TIMEOUT = 500;
|
|
@@ -40,6 +40,7 @@ export default class ScrollView {
|
|
this.slideHTMLBeforeActivation = this.Reveal.getSlidesElement().innerHTML;
|
|
this.slideHTMLBeforeActivation = this.Reveal.getSlidesElement().innerHTML;
|
|
|
|
|
|
const horizontalSlides = queryAll( this.Reveal.getRevealElement(), HORIZONTAL_SLIDES_SELECTOR );
|
|
const horizontalSlides = queryAll( this.Reveal.getRevealElement(), HORIZONTAL_SLIDES_SELECTOR );
|
|
|
|
+ const slideBackgrounds = queryAll( this.Reveal.getRevealElement(), SLIDES_BACKGROUNDS_SELECTOR );
|
|
|
|
|
|
this.viewportElement.classList.add( 'loading-scroll-mode', 'reveal-scroll' );
|
|
this.viewportElement.classList.add( 'loading-scroll-mode', 'reveal-scroll' );
|
|
|
|
|
|
@@ -76,8 +77,19 @@ export default class ScrollView {
|
|
page.className = 'scroll-page';
|
|
page.className = 'scroll-page';
|
|
pageElements.push( page );
|
|
pageElements.push( page );
|
|
|
|
|
|
- // Copy the presentation-wide background to each page
|
|
|
|
- if( presentationBackground ) {
|
|
|
|
|
|
+ // This transfers over the background of the vertical stack containing
|
|
|
|
+ // the slide if it exists. Otherwise, it uses the presentation-wide
|
|
|
|
+ // background.
|
|
|
|
+ if( slideBackgrounds && slideBackgrounds.length > h ) {
|
|
|
|
+ const slideBackground = slideBackgrounds[h];
|
|
|
|
+ const pageBackground = window.getComputedStyle( slideBackground );
|
|
|
|
+
|
|
|
|
+ if( pageBackground && pageBackground.background ) {
|
|
|
|
+ page.style.background = pageBackground.background;
|
|
|
|
+ } else if( presentationBackground ) {
|
|
|
|
+ page.style.background = presentationBackground;
|
|
|
|
+ }
|
|
|
|
+ } else if( presentationBackground ) {
|
|
page.style.background = presentationBackground;
|
|
page.style.background = presentationBackground;
|
|
}
|
|
}
|
|
|
|
|