diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-08-19 11:23:19 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-08-19 11:23:19 -0700 |
commit | 7219bc99f5f018bb86283333660241d1774845fa (patch) | |
tree | 027e6f2163832b0ce2a126635ab3c9fb0e6be6d5 | |
parent | 112bf36f88beff12e8196542444c531f1493c6ee (diff) |
fixing deck and model not being set correctly
-rw-r--r-- | ext/bg/js/settings.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js index 7bdd9f84..b8cb4afe 100644 --- a/ext/bg/js/settings.js +++ b/ext/bg/js/settings.js @@ -331,11 +331,6 @@ function ankiFieldsToDict(selection) { async function ankiDeckAndModelPopulate(options) { const ankiFormat = $('#anki-format').hide(); - const ankiTermsModel = $('#anki-terms-model').val(options.anki.terms.model); - const ankiKanjiModel = $('#anki-kanji-model').val(options.anki.kanji.model); - - $('#anki-terms-deck').val(options.anki.terms.deck); - $('#anki-kanji-deck').val(options.anki.kanji.deck); const deckNames = await utilAnkiGetDeckNames(); const ankiDeck = $('.anki-deck'); @@ -347,8 +342,11 @@ async function ankiDeckAndModelPopulate(options) { ankiModel.find('option').remove(); modelNames.sort().forEach(name => ankiModel.append($('<option/>', {value: name, text: name}))); - await ankiFieldsPopulate(ankiTermsModel, options); - await ankiFieldsPopulate(ankiKanjiModel, options); + $('#anki-terms-deck').val(options.anki.terms.deck); + await ankiFieldsPopulate($('#anki-terms-model').val(options.anki.terms.model), options); + + $('#anki-kanji-deck').val(options.anki.kanji.deck); + await ankiFieldsPopulate($('#anki-kanji-model').val(options.anki.kanji.model), options); ankiFormat.show(); } |