Skip to content

Commit

Permalink
that was impressive name switch :)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartaz committed Jan 18, 2012
1 parent 5ea857e commit 5fc00a1
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions js/impress.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,20 +253,18 @@
return el;
};

var selectNext = function () {
var next = active;
next = steps.indexOf( active ) - 1;
next = next >= 0 ? steps[ next ] : steps[ steps.length-1 ];
var selectPrev = function () {
var prev = steps.indexOf( active ) - 1;
prev = prev >= 0 ? steps[ prev ] : steps[ steps.length-1 ];

return select(next);
return select(prev);
};

var selectPrev = function () {
var prev = active;
prev = steps.indexOf( active ) + 1;
prev = prev < steps.length ? steps[ prev ] : steps[ 0 ];
var selectNext = function () {
var next = steps.indexOf( active ) + 1;
next = next < steps.length ? steps[ next ] : steps[ 0 ];

return select(prev);
return select(next);
};

// EVENTS
Expand All @@ -277,14 +275,14 @@
case 33: ; // pg up
case 37: ; // left
case 38: // up
selectNext();
selectPrev();
break;
case 9: ; // tab
case 32: ; // space
case 34: ; // pg down
case 39: ; // right
case 40: // down
selectPrev();
selectNext();
break;
}

Expand Down

0 comments on commit 5fc00a1

Please sign in to comment.