summaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-13 11:37:54 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-13 11:37:54 -0800
commit7598de2234393433e98c9af3c312a1bcfd82c32f (patch)
tree46edf8a00733bd0d9d308758e8d1256f30d44e85 /ext/bg/js/options-form.js
parent320a82146b8673dcc1f5ba4717a8948e8f114010 (diff)
Cleanup
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 81b638b1..736ec023 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -127,7 +127,7 @@ function populateDictionaries(opts) {
return database().getDictionaries().then(rows => {
rows.forEach(row => {
- const dictOpts = opts.dictionaries[row.title] || {enableTerms: true, enableKanji: false};
+ const dictOpts = opts.dictionaries[row.title] || {enableTerms: false, enableKanji: false};
const html = Handlebars.templates['dictionary.html']({
title: row.title,
version: row.version,
@@ -198,7 +198,10 @@ function onDictionaryImport() {
const dictUrl = $('#dict-url');
loadOptions().then(opts => {
- database().importDictionary(dictUrl.val(), callback).then(() => {
+ database().importDictionary(dictUrl.val(), callback).then(summary => {
+ opts.dictionaries[summary.title] = {hasTerms: summary.hasTerms, hasKanji: summary.hasKanji};
+ return saveOptions(opts);
+ }).then(() => {
return populateDictionaries(opts);
}).catch(error => {
dictError.show().find('span').text(error);