From 8e2134bb56ab659f74cb79b399137d83a3457e27 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 26 Mar 2016 18:10:22 -0700 Subject: WIP --- ext/bg/yomichan.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'ext/bg') diff --git a/ext/bg/yomichan.js b/ext/bg/yomichan.js index 196785e1..971e739c 100644 --- a/ext/bg/yomichan.js +++ b/ext/bg/yomichan.js @@ -33,14 +33,12 @@ class Yomichan { chrome.browserAction.onClicked.addListener(this.onBrowserAction.bind(this)); } - onFindTerm({term}) { - return this.translator.findTerm(term); - } - onMessage(request, sender, callback) { const {action, data} = request; const handler = { - findTerm: this.onFindTerm + findKanji: ({text}) => this.translator.onFindKanji(text), + findTerm: ({text}) => this.translator.findTerm(text), + getState: () => this.state }[action]; if (handler !== null) { -- cgit v1.2.3