From 5fc00a1cf637ea9e82f9d4bfc6d89b84addd6b3a Mon Sep 17 00:00:00 2001 From: Bartek Szopka Date: Wed, 18 Jan 2012 12:26:16 +0100 Subject: [PATCH] that was impressive name switch :) --- js/impress.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/js/impress.js b/js/impress.js index d4511568e..8edcad024 100644 --- a/js/impress.js +++ b/js/impress.js @@ -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 @@ -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; }