1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-15 02:58:20 +02:00

Merge branch 'master' into feature/reader-mode

This commit is contained in:
Hakim El Hattab
2023-10-12 14:04:36 +02:00
committed by GitHub
6 changed files with 24 additions and 9 deletions

View File

@@ -287,7 +287,18 @@ export default function( revealElement, options ) {
if( !config.showHiddenSlides ) {
Util.queryAll( dom.wrapper, 'section[data-visibility="hidden"]' ).forEach( slide => {
slide.parentNode.removeChild( slide );
const parent = slide.parentNode;
// If this slide is part of a stack and that stack will be
// empty after removing the hidden slide, remove the entire
// stack
if( parent.childElementCount === 1 && /section/i.test( parent.nodeName ) ) {
parent.remove();
}
else {
slide.remove();
}
} );
}
@@ -473,8 +484,8 @@ export default function( revealElement, options ) {
dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition );
// Expose our configured slide dimensions as custom props
dom.viewport.style.setProperty( '--slide-width', config.width + 'px' );
dom.viewport.style.setProperty( '--slide-height', config.height + 'px' );
dom.viewport.style.setProperty( '--slide-width', typeof config.width == 'string' ? config.width : config.width + 'px' );
dom.viewport.style.setProperty( '--slide-height', typeof config.height == 'string' ? config.height : config.height + 'px' );
if( config.shuffle ) {
shuffle();