summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/anki-templates-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-10-10 20:58:38 -0400
committerGitHub <noreply@github.com>2020-10-10 20:58:38 -0400
commit25c590e54b3086558c10765a4df6f1ddea00fc54 (patch)
tree6b87a8b7c319fa201d353c9a8df321dab784e643 /ext/bg/js/settings/anki-templates-controller.js
parent0244d07ea9afc0a7893c1ba448ec284e95a55073 (diff)
Add modal controller class (#908)
* Add ModalController * Use modalController instead of new Modal
Diffstat (limited to 'ext/bg/js/settings/anki-templates-controller.js')
-rw-r--r--ext/bg/js/settings/anki-templates-controller.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/bg/js/settings/anki-templates-controller.js b/ext/bg/js/settings/anki-templates-controller.js
index f2e5be43..65900336 100644
--- a/ext/bg/js/settings/anki-templates-controller.js
+++ b/ext/bg/js/settings/anki-templates-controller.js
@@ -23,8 +23,9 @@
*/
class AnkiTemplatesController {
- constructor(settingsController, ankiController) {
+ constructor(settingsController, modalController, ankiController) {
this._settingsController = settingsController;
+ this._modalController = modalController;
this._ankiController = ankiController;
this._cachedDefinitionValue = null;
this._cachedDefinitionText = null;
@@ -36,7 +37,7 @@ class AnkiTemplatesController {
async prepare() {
this._defaultFieldTemplates = await api.getDefaultAnkiFieldTemplates();
- this._fieldTemplateResetModal = new Modal(document.querySelector('#field-template-reset-modal'));
+ this._fieldTemplateResetModal = this._modalController.getModal('field-template-reset-modal');
const markers = new Set([
...this._ankiController.getFieldMarkers('terms'),