aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 050caf4e..f3423878 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -140,9 +140,8 @@ class Display {
}
entryScroll(index, smooth) {
- if (index < 0 || index >= this.definitions.length) {
- return;
- }
+ index = Math.min(index, this.definitions.length - 1);
+ index = Math.max(index, 0);
$('.current').hide().eq(index).show();
@@ -217,6 +216,14 @@ class Display {
this.entryScroll(this.definitions.length - 1, true);
},
+ 33: /* page up */ () => {
+ this.entryScroll(this.index - 3, true);
+ },
+
+ 34: /* page down */ () => {
+ this.entryScroll(this.index + 3, true);
+ },
+
38: /* up */ () => {
this.entryScroll(this.index - 1, true);
},