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.js42
1 files changed, 17 insertions, 25 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 30f703bb..140185cc 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -50,6 +50,10 @@ class Display {
throw 'override me';
}
+ clearSearch() {
+ throw 'override me';
+ }
+
showTermDefs(definitions, options, context) {
window.focus();
@@ -207,17 +211,13 @@ class Display {
}
onKeyDown(e) {
- const notifyParent = action => {
- window.parent.postMessage(action, '*');
- };
-
const handlers = {
- 36: /* home */ () => {
- this.entryScroll(0, true);
+ 8: /* backspace */ () => {
+
},
- 35: /* end */ () => {
- this.entryScroll(this.definitions.length - 1, true);
+ 27: /* escape */ () => {
+ this.clearSearch();
},
33: /* page up */ () => {
@@ -228,6 +228,14 @@ class Display {
this.entryScroll(this.index + 3, true);
},
+ 35: /* end */ () => {
+ this.entryScroll(this.definitions.length - 1, true);
+ },
+
+ 36: /* home */ () => {
+ this.entryScroll(0, true);
+ },
+
38: /* up */ () => {
this.entryScroll(this.index - 1, true);
},
@@ -240,28 +248,12 @@ class Display {
},
- 221: /* ] */ () => {
-
- },
-
220: /* \ */ () => {
this.audioPlay(this.definitions[this.index]);
},
- 8: /* backspace */ () => {
-
- },
-
- 27: /* escape */ () => {
- notifyParent('popupClose');
- },
-
- 37: /* left */ () => {
- notifyParent('scanLeft');
- },
+ 221: /* ] */ () => {
- 39: /* right */ () => {
- notifyParent('scanRight');
}
};