mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-06 22:57:21 +02:00
fix slide backgrounds being replaced by global background
This commit is contained in:
2
dist/reveal.esm.js
vendored
2
dist/reveal.esm.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.esm.js.map
vendored
2
dist/reveal.esm.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js
vendored
2
dist/reveal.js
vendored
File diff suppressed because one or more lines are too long
2
dist/reveal.js.map
vendored
2
dist/reveal.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -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' );
|
||||||
|
|
||||||
@@ -79,7 +80,16 @@ export default class ScrollView {
|
|||||||
pageElements.push( page );
|
pageElements.push( page );
|
||||||
|
|
||||||
// Copy the presentation-wide background to each page
|
// Copy the presentation-wide background to each page
|
||||||
if( presentationBackground ) {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
export const SLIDES_SELECTOR = '.slides section';
|
export const SLIDES_SELECTOR = '.slides section';
|
||||||
export const HORIZONTAL_SLIDES_SELECTOR = '.slides>section';
|
export const HORIZONTAL_SLIDES_SELECTOR = '.slides>section';
|
||||||
export const VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section';
|
export const VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section';
|
||||||
|
export const SLIDES_BACKGROUNDS_SELECTOR = '.slides>.backgrounds>.slide-background';
|
||||||
|
|
||||||
// Methods that may not be invoked via the postMessage API
|
// Methods that may not be invoked via the postMessage API
|
||||||
export const POST_MESSAGE_METHOD_BLACKLIST = /registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview/;
|
export const POST_MESSAGE_METHOD_BLACKLIST = /registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener|showPreview/;
|
||||||
|
Reference in New Issue
Block a user