fix bug where hiding all except 1 slide in a stack caused controls to break
This commit is contained in:
parent
a6417ae747
commit
f979ff68e9
1 changed files with 6 additions and 1 deletions
7
js/controllers/controls.js
vendored
7
js/controllers/controls.js
vendored
|
|
@ -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.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' ); } );
|
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
|
// Apply fragment decorators to directional buttons based on
|
||||||
// what slide axis they are in
|
// 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.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' ); } );
|
if( fragmentsRoutes.next ) this.controlsDown.forEach( el => { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue