diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/js/pages/settings/anki-controller.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js index 7eb09c85..2d461336 100644 --- a/ext/js/pages/settings/anki-controller.js +++ b/ext/js/pages/settings/anki-controller.js @@ -582,6 +582,17 @@ class AnkiCardController { this._ankiCardFieldsContainer = this._node.querySelector('.anki-card-fields'); + /** @type {HTMLTextAreaElement} */ + const mainSettingsEntry = querySelectorNotNull(document, '[data-modal-action="show,anki-cards"]'); + mainSettingsEntry.addEventListener('click', (() => { + const updatedCardOptions = this._getCardOptions(ankiOptions, this._optionsType); + if (updatedCardOptions === null) { return; } + this._deckController.prepare(deckControllerSelect, updatedCardOptions.deck); + this._modelController.prepare(modelControllerSelect, updatedCardOptions.model); + this._fields = updatedCardOptions.fields; + void this.updateAnkiState(); + }).bind(this), false); + this._setupFields(); this._eventListeners.addEventListener(this._deckController.select, 'change', this._onCardDeckChange.bind(this), false); |