fix up and down key shortcuts
authorgc <gc>
Sun, 3 Jul 2005 16:35:56 +0000 (16:35 +0000)
committergc <gc>
Sun, 3 Jul 2005 16:35:56 +0000 (16:35 +0000)
lib/booh/html-merges.rb

index 0ab9e4056de877356990667550fa701f7a1057a4..ac9b33f25306676fe802d4846b16ba5507a70390 100644 (file)
@@ -277,6 +277,19 @@ function next() {
     }
 }
 
+function next10() {
+    if (slideshow == 1) {
+        toggle_slideshow(true);
+    }
+
+    if (current < images.length - 11) {
+        current += 10;
+    } else {
+        current = images.length - 1;
+    }
+    display_current();
+}
+
 function previous() {
     if (slideshow == 1) {
         toggle_slideshow(true);
@@ -288,6 +301,19 @@ function previous() {
     }
 }
 
+function previous10() {
+    if (slideshow == 1) {
+        toggle_slideshow(true);
+    }
+
+    if (current > 10) {
+        current -= 10;
+    } else {
+        current = 0;
+    }
+    display_current();
+}
+
 function last() {
     if (slideshow == 1) {
         toggle_slideshow(true);
@@ -316,14 +342,10 @@ function keyDownEvent(key) {
         next();
         break;
       case 38: // up
-        for (i = 0; i < 10; i++) { 
-            previous();
-        }
+        previous10();
         break;
       case 40: // down
-        for (i = 0; i < 10; i++) { 
-            next();
-        }
+        next10();
         break;
     }
 }