From 58dc6b7c3654f2c4383e608763ba84f3e0ea4221 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 16 May 2017 09:43:16 +0200 Subject: adjust controls layout when there are no vertical or horizontal slides in the deck --- js/reveal.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js') diff --git a/js/reveal.js b/js/reveal.js index 02dbebe..42c3822 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2739,6 +2739,22 @@ } } + // Flag if there are ANY vertical slides, anywhere in the deck + if( dom.wrapper.querySelectorAll( '.slides>section>section' ).length ) { + dom.wrapper.classList.add( 'has-vertical-slides' ); + } + else { + dom.wrapper.classList.remove( 'has-vertical-slides' ); + } + + // Flag if there are ANY horizontal slides, anywhere in the deck + if( dom.wrapper.querySelectorAll( '.slides>section:not(.stack)' ).length ) { + dom.wrapper.classList.add( 'has-horizontal-slides' ); + } + else { + dom.wrapper.classList.remove( 'has-horizontal-slides' ); + } + } } -- cgit v1.2.3