Skip to content

Commit

Permalink
fix bug where hiding all except 1 slide in a stack caused controls to…
Browse files Browse the repository at this point in the history
… break
  • Loading branch information
hakimel committed Oct 29, 2024
1 parent a6417ae commit f979ff6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/controllers/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,14 @@ export default class Controls {
if( fragmentsRoutes.prev ) this.controlsPrev.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
if( fragmentsRoutes.next ) this.controlsNext.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );

const isVerticalStack = this.Reveal.isVerticalSlide( currentSlide );
const hasVerticalSiblings = isVerticalStack &&
currentSlide.parentElement &&
currentSlide.parentElement.querySelectorAll( ':scope > section' ).length > 1;

// Apply fragment decorators to directional buttons based on
// what slide axis they are in
if( this.Reveal.isVerticalSlide( currentSlide ) ) {
if( isVerticalStack && hasVerticalSiblings ) {
if( fragmentsRoutes.prev ) this.controlsUp.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
if( fragmentsRoutes.next ) this.controlsDown.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
}
Expand Down

0 comments on commit f979ff6

Please sign in to comment.