diff options
Diffstat (limited to 'ext/fg/js/client.js')
-rw-r--r-- | ext/fg/js/client.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/fg/js/client.js b/ext/fg/js/client.js index 44a3b84c..7f07d918 100644 --- a/ext/fg/js/client.js +++ b/ext/fg/js/client.js @@ -77,9 +77,11 @@ class Client { } onFrameMessage(e) { - // const {action, data} = e.data; - // switch (action) { - // } + const {action, data} = e.data, handlers = { + displayKanji: this.displayKanji + }; + + handlers[action].call(this, data); } searchAt(point) { @@ -134,6 +136,10 @@ class Client { this.lastRange = null; } + displayKanji(kanji) { + this.popup.setContent(kanji); + } + setEnabled(enabled) { if (!(this.enabled = enabled)) { this.hidePopup(); |