diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-01-22 19:51:14 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-01-22 19:51:14 -0800 |
commit | 72fbcc26fbc8b38e058cdb5c7346954c2442eeff (patch) | |
tree | da2c6d269cd3758e8581ef4b5c70eab2bfe32db8 /ext/bg/js | |
parent | 5cd3e35f9e5e219ea9d33e4d16ca6bf9da352565 (diff) |
sort deck names and model names
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/options-form.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js index 84101ba0..eafb3e09 100644 --- a/ext/bg/js/options-form.js +++ b/ext/bg/js/options-form.js @@ -309,14 +309,14 @@ function populateAnkiDeckAndModel(options) { return Promise.all([anki().getDeckNames(), anki().getModelNames()]).then(([deckNames, modelNames]) => { const ankiDeck = $('.anki-deck'); ankiDeck.find('option').remove(); - deckNames.forEach(name => ankiDeck.append($('<option/>', {value: name, text: name}))); + deckNames.sort().forEach(name => ankiDeck.append($('<option/>', {value: name, text: name}))); $('#anki-terms-deck').val(options.anki.terms.deck); $('#anki-kanji-deck').val(options.anki.kanji.deck); const ankiModel = $('.anki-model'); ankiModel.find('option').remove(); - modelNames.forEach(name => ankiModel.append($('<option/>', {value: name, text: name}))); + modelNames.sort().forEach(name => ankiModel.append($('<option/>', {value: name, text: name}))); return Promise.all([ populateAnkiFields($('#anki-terms-model').val(options.anki.terms.model), options), |