|
@@ -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();
|