summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/backup-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/backup-controller.js
parent0244d07ea9afc0a7893c1ba448ec284e95a55073 (diff)
Add modal controller class (#908)
* Add ModalController * Use modalController instead of new Modal
Diffstat (limited to 'ext/bg/js/settings/backup-controller.js')
-rw-r--r--ext/bg/js/settings/backup-controller.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/bg/js/settings/backup-controller.js b/ext/bg/js/settings/backup-controller.js
index 80f83eb7..50390d5c 100644
--- a/ext/bg/js/settings/backup-controller.js
+++ b/ext/bg/js/settings/backup-controller.js
@@ -22,8 +22,9 @@
*/
class BackupController {
- constructor(settingsController) {
+ constructor(settingsController, modalController) {
this._settingsController = settingsController;
+ this._modalController = modalController;
this._settingsExportToken = null;
this._settingsExportRevoke = null;
this._currentVersion = 0;
@@ -36,9 +37,9 @@ class BackupController {
async prepare() {
await this._optionsUtil.prepare();
- this._settingsResetModal = new Modal(document.querySelector('#settings-reset-modal'));
- this._settingsImportErrorModal = new Modal(document.querySelector('#settings-import-error-modal'));
- this._settingsImportWarningModal = new Modal(document.querySelector('#settings-import-warning-modal'));
+ this._settingsResetModal = this._modalController.getModal('settings-reset-modal');
+ this._settingsImportErrorModal = this._modalController.getModal('settings-import-error-modal');
+ this._settingsImportWarningModal = this._modalController.getModal('settings-import-warning-modal');
document.querySelector('#settings-export').addEventListener('click', this._onSettingsExportClick.bind(this), false);
document.querySelector('#settings-import').addEventListener('click', this._onSettingsImportClick.bind(this), false);