diff options
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/js/reveal.js b/js/reveal.js index 8d48814..cd53e03 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -73,6 +73,9 @@ var Reveal = (function(){ // Transition style transition: 'default', // default/cube/page/concave/zoom/linear/fade/none + // Transition speed + transitionSpeed: 'default', // default/fast/slow + // Script dependencies to load dependencies: [] }, @@ -340,6 +343,8 @@ var Reveal = (function(){ dom.wrapper.classList.add( config.transition ); + dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed ); + if( dom.controls ) { dom.controls.style.display = ( config.controls && dom.controls ) ? 'block' : 'none'; } @@ -1440,13 +1445,14 @@ var Reveal = (function(){ * index will be for this slide rather than the currently * active one * - * @return {Object} { h: <int>, v: <int> } + * @return {Object} { h: <int>, v: <int>, f: <int> } */ function getIndices( slide ) { // By default, return the current indices var h = indexh, - v = indexv; + v = indexv, + f; // If a slide is specified, return the indices of that slide if( slide ) { @@ -1465,7 +1471,14 @@ var Reveal = (function(){ } } - return { h: h, v: v }; + if( !slide && currentSlide ) { + var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' ); + if( visibleFragments.length ) { + f = visibleFragments.length; + } + } + + return { h: h, v: v, f: f }; } @@ -1569,7 +1582,7 @@ var Reveal = (function(){ function navigateLeft() { // Prioritize hiding fragments - if( availableRoutes().left && ( isOverview() || previousFragment() === false ) ) { + if( ( isOverview() || previousFragment() === false ) && availableRoutes().left ) { slide( indexh - 1 ); } @@ -1578,7 +1591,7 @@ var Reveal = (function(){ function navigateRight() { // Prioritize revealing fragments - if( availableRoutes().right && ( isOverview() || nextFragment() === false ) ) { + if( ( isOverview() || nextFragment() === false ) && availableRoutes().right ) { slide( indexh + 1 ); } @@ -1587,7 +1600,7 @@ var Reveal = (function(){ function navigateUp() { // Prioritize hiding fragments - if( availableRoutes().up && isOverview() || previousFragment() === false ) { + if( ( isOverview() || previousFragment() === false ) && availableRoutes().up ) { slide( indexh, indexv - 1 ); } @@ -1596,7 +1609,7 @@ var Reveal = (function(){ function navigateDown() { // Prioritize revealing fragments - if( availableRoutes().down && isOverview() || nextFragment() === false ) { + if( ( isOverview() || nextFragment() === false ) && availableRoutes().down ) { slide( indexh, indexv + 1 ); } @@ -1622,7 +1635,7 @@ var Reveal = (function(){ if( previousSlide ) { indexv = ( previousSlide.querySelectorAll( 'section' ).length + 1 ) || undefined; indexh --; - slide(); + slide( indexh, indexv ); } } } |