diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-11-04 08:18:49 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-11-04 08:18:49 -0700 |
commit | d505edb94b27ecd8cbaaecd11cbebfbe12b16164 (patch) | |
tree | 44ab656f33f7eedb0e4e0c9e31e0ccceffb069e0 /ext/bg/js/api.js | |
parent | 5c0d1cc6dae358dd2c04bdaac8f30cebfad5466d (diff) | |
parent | dcef7ce3774a3dcc8e7bee0bc17398251523451e (diff) |
Merge branch 'dev'
Diffstat (limited to 'ext/bg/js/api.js')
-rw-r--r-- | ext/bg/js/api.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 9f65bb07..de3ad64e 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -29,9 +29,11 @@ async function apiTermsFind(text) { const options = utilBackend().options; const translator = utilBackend().translator; - const searcher = options.general.groupResults ? - translator.findTermsGrouped.bind(translator) : - translator.findTermsSplit.bind(translator); + const searcher = { + 'merge': translator.findTermsMerged, + 'split': translator.findTermsSplit, + 'group': translator.findTermsGrouped + }[options.general.resultOutputMode].bind(translator); const {definitions, length} = await searcher( text, |