aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-25 12:21:25 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-25 12:21:25 -0700
commit4a232151e065400495ec2ed0ca57dff8da84c4b7 (patch)
tree3f96fc380fecf7ea91468b2b7588332b47dba612 /ext/mixed
parentff3315ebf147a3e8d1cab5726724b20a2694aa73 (diff)
more keyboard shortcuts
Diffstat (limited to 'ext/mixed')
-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);
},