Skip to content

Commit f979ff6

Browse files
committed
fix bug where hiding all except 1 slide in a stack caused controls to break
1 parent a6417ae commit f979ff6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

js/controllers/controls.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,14 @@ export default class Controls {
146146
if( fragmentsRoutes.prev ) this.controlsPrev.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
147147
if( fragmentsRoutes.next ) this.controlsNext.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
148148

149+
const isVerticalStack = this.Reveal.isVerticalSlide( currentSlide );
150+
const hasVerticalSiblings = isVerticalStack &&
151+
currentSlide.parentElement &&
152+
currentSlide.parentElement.querySelectorAll( ':scope > section' ).length > 1;
153+
149154
// Apply fragment decorators to directional buttons based on
150155
// what slide axis they are in
151-
if( this.Reveal.isVerticalSlide( currentSlide ) ) {
156+
if( isVerticalStack && hasVerticalSiblings ) {
152157
if( fragmentsRoutes.prev ) this.controlsUp.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
153158
if( fragmentsRoutes.next ) this.controlsDown.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
154159
}

0 commit comments

Comments
 (0)