aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorCatalin Buzoiu <cbuzoiu@gmail.com>2012-03-27 18:45:04 +0300
committerCatalin Buzoiu <cbuzoiu@gmail.com>2012-03-27 18:45:04 +0300
commit732ed921ebc693d29988c73ba1f28a986dd8f143 (patch)
tree3f7c0c6f424ab92dc81cd32ed6696185de1eddcc /js
parentbe76bf3d232d57a86e3fced0e73defb8aef37fbf (diff)
downloadperl-software-in-gnu-guix-732ed921ebc693d29988c73ba1f28a986dd8f143.tar
perl-software-in-gnu-guix-732ed921ebc693d29988c73ba1f28a986dd8f143.tar.gz
Implemented correct Previous and Next navigation for both mouse scroll and wireless presenter.
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 2ecd641..adc5278 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -187,8 +187,8 @@ var Reveal = (function(){
if( event.keyCode >= 33 && event.keyCode <= 40 ) {
switch( event.keyCode ) {
- case 33: navigateLeft(); break; // left for wireless presenter
- case 34: navigateRight(); break; // right for wireless presenter
+ case 33: navigatePrev(); break; // prev for wireless presenter (PgUp)
+ case 34: navigateNext(); break; // next for wireless presenter (PgDn)
case 37: navigateLeft(); break; // left
case 39: navigateRight(); break; // right
case 38: navigateUp(); break; // up
@@ -271,10 +271,10 @@ var Reveal = (function(){
mouseWheelTimeout = setTimeout( function() {
var delta = event.detail || -event.wheelDelta;
if( delta > 0 ) {
- availableRoutes().down ? navigateDown() : navigateRight();
+ navigateNext();
}
else {
- availableRoutes().up ? navigateUp() : navigateLeft();
+ navigatePrev();
}
}, 100 );
}
@@ -659,6 +659,22 @@ var Reveal = (function(){
slide();
}
}
+ function navigatePrev() {
+ if( availableRoutes().up ) navigateUp();
+ else {
+ // Go to last slide in previous vertical stack
+ var pastSlides = document.querySelectorAll('#reveal .slides>section.past');
+ if( pastSlides.length > 0 ) {
+ var prevVerticalSlides = pastSlides[pastSlides.length - 1].querySelectorAll('section');
+ indexv = prevVerticalSlides.length > 0 ? prevVerticalSlides.length - 1 : 0;
+ indexh --;
+ slide();
+ }
+ }
+ }
+ function navigateNext() {
+ availableRoutes().down ? navigateDown() : navigateRight();
+ }
// Expose some methods publicly
return {