diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-03-25 15:59:33 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-03-25 15:59:33 -0700 |
commit | b8d0788144974daab8d55c8de1af7515a291ba4f (patch) | |
tree | 32d778204049561b7f20c2e1a914ff6840340e86 /ext/mixed | |
parent | 90eaae1725511bbc039f84f684b7b080e0fa2d44 (diff) |
wip
Diffstat (limited to 'ext/mixed')
-rw-r--r-- | ext/mixed/js/display.js | 42 |
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'); } }; |