summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-05-28 15:21:01 -0700
committerAlex Yatskov <alex@foosoft.net>2016-05-28 15:21:01 -0700
commitb229295688396160256d2501d494a9ce221eb5fd (patch)
treecd3a56aa6e4af013fe7617bd8b7dea82357a0034 /ext/bg/js
parent9c51f2ecda326157a5afa5962dee79c1344c9e1f (diff)
More cleanup
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/options-form.js23
1 files changed, 12 insertions, 11 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index 849916bd..0f2fcc6a 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -55,18 +55,19 @@ function populateAnkiDeckAndModel(opts) {
names.forEach((name) => ankiDeck.append($('<option/>', {value: name, text: name})));
}
- const ankiModel = $('.anki-model');
- ankiModel.find('option').remove();
- yomi.api_getModelNames({callback: (names) => {
- if (names !== null) {
- names.forEach((name) => ankiModel.append($('<option/>', {value: name, text: name})));
- }
+ $('#anki-vocab-deck').val(opts.ankiVocabDeck);
+ $('#anki-kanji-deck').val(opts.ankiKanjiDeck);
+ }});
+
+ const ankiModel = $('.anki-model');
+ ankiModel.find('option').remove();
+ yomi.api_getModelNames({callback: (names) => {
+ if (names !== null) {
+ names.forEach((name) => ankiModel.append($('<option/>', {value: name, text: name})));
+ }
- $('#anki-vocab-deck').val(opts.ankiVocabDeck);
- populateAnkiFields($('#anki-vocab-model').val(opts.ankiVocabModel), opts);
- $('#anki-kanji-deck').val(opts.ankiKanjiDeck);
- populateAnkiFields($('#anki-kanji-model').val(opts.ankiKanjiModel), opts);
- }});
+ populateAnkiFields($('#anki-vocab-model').val(opts.ankiVocabModel), opts);
+ populateAnkiFields($('#anki-kanji-model').val(opts.ankiKanjiModel), opts);
}});
}