From c62f4c7cfbe72850a8df2167f04fb8d1d45fcb02 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Wed, 29 May 2019 10:22:15 -0400 Subject: [PATCH 1/2] * Linear Navigation: Fix showing arrows when last slide has vertical children --- js/reveal.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/reveal.js b/js/reveal.js index 0065e9b8..fbcb2811 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3951,6 +3951,11 @@ } } + if( config.navigationMode === "linear" ) { + routes.right = routes.right || routes.down; + routes.left = routes.left || routes.up; + } + // Reverse horizontal controls for rtl if( config.rtl ) { var left = routes.left; From 969e7b3ef18e0de174d5c6a02ad44c2774753cf5 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Wed, 29 May 2019 10:32:49 -0400 Subject: [PATCH 2/2] * Mobile Linear Navigation: Fix swipes to navigate linearly --- js/reveal.js | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index fbcb2811..a449e751 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3951,7 +3951,7 @@ } } - if( config.navigationMode === "linear" ) { + if( config.navigationMode === 'linear' ) { routes.right = routes.right || routes.down; routes.left = routes.left || routes.up; } @@ -5441,19 +5441,49 @@ if( deltaX > touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { touch.captured = true; - navigateLeft(); + if (config.navigationMode === 'linear') { + if( config.rtl ) { + navigateNext(); + } + else { + navigatePrev(); + } + } + else { + navigateLeft(); + } } else if( deltaX < -touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) { touch.captured = true; - navigateRight(); + if (config.navigationMode === 'linear') { + if( config.rtl ) { + navigatePrev(); + } + else { + navigateNext(); + } + } + else { + navigateRight(); + } } else if( deltaY > touch.threshold ) { touch.captured = true; - navigateUp(); + if (config.navigationMode === 'linear') { + navigatePrev(); + } + else { + navigateUp(); + } } else if( deltaY < -touch.threshold ) { touch.captured = true; - navigateDown(); + if (config.navigationMode === 'linear') { + navigateNext(); + } + else { + navigateDown(); + } } // If we're embedded, only block touch events if they have