aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-03-25 15:59:33 -0700
committerAlex Yatskov <alex@foosoft.net>2017-03-25 15:59:33 -0700
commitb8d0788144974daab8d55c8de1af7515a291ba4f (patch)
tree32d778204049561b7f20c2e1a914ff6840340e86 /ext/mixed/js/display.js
parent90eaae1725511bbc039f84f684b7b080e0fa2d44 (diff)
wip
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');
}
};