aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2014-10-16 16:17:41 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2014-10-16 16:17:41 +0200
commit82342672ea09ed46580b25bd2d137f056d5faaa0 (patch)
treeac3ef064d7a78412385b2f77c87a62e67f059087 /js
parent6c7ba34edf1dfff171fa808ff15796c2dac13b1c (diff)
downloadfosdem-2018-presentation-82342672ea09ed46580b25bd2d137f056d5faaa0.tar
fosdem-2018-presentation-82342672ea09ed46580b25bd2d137f056d5faaa0.tar.gz
fix navigatePrev in rtl mode #1030
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js30
1 files changed, 22 insertions, 8 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 4b1fbc8..1b7e432 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -3426,10 +3426,20 @@
navigateUp();
}
else {
+ // Fetch the previous horizontal slide, if there is one
+ var previousSlide;
+
if( config.rtl ) {
- navigateRight();
- } else {
- navigateLeft();
+ previousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.future' ) ).pop();
+ }
+ else {
+ previousSlide = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.past' ) ).pop();
+ }
+
+ if( previousSlide ) {
+ var v = ( previousSlide.querySelectorAll( 'section' ).length - 1 ) || undefined;
+ var h = indexh - 1;
+ slide( h, v );
}
}
}
@@ -3437,16 +3447,20 @@
}
/**
- * Same as #navigatePrev() but navigates forwards.
+ * The reverse of #navigatePrev().
*/
function navigateNext() {
// Prioritize revealing fragments
if( nextFragment() === false ) {
- if( config.rtl ) {
- availableRoutes().down ? navigateDown() : navigateLeft();
- } else {
- availableRoutes().down ? navigateDown() : navigateRight();
+ if( availableRoutes().down ) {
+ navigateDown();
+ }
+ else if( config.rtl ) {
+ navigateLeft();
+ }
+ else {
+ navigateRight();
}
}