summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/profile-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/profile-controller.js
parent0244d07ea9afc0a7893c1ba448ec284e95a55073 (diff)
Add modal controller class (#908)
* Add ModalController * Use modalController instead of new Modal
Diffstat (limited to 'ext/bg/js/settings/profile-controller.js')
-rw-r--r--ext/bg/js/settings/profile-controller.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/bg/js/settings/profile-controller.js b/ext/bg/js/settings/profile-controller.js
index 7c6dfae5..63a82c40 100644
--- a/ext/bg/js/settings/profile-controller.js
+++ b/ext/bg/js/settings/profile-controller.js
@@ -22,8 +22,9 @@
*/
class ProfileController {
- constructor(settingsController) {
+ constructor(settingsController, modalController) {
this._settingsController = settingsController;
+ this._modalController = modalController;
this._profileConditionsUI = new ProfileConditionsUI(settingsController);
this._profileActiveSelect = null;
this._profileTargetSelect = null;
@@ -52,8 +53,8 @@ class ProfileController {
this._profileCopyButton = document.querySelector('#profile-copy');
this._profileMoveUpButton = document.querySelector('#profile-move-up');
this._profileMoveDownButton = document.querySelector('#profile-move-down');
- this._profileRemoveModal = new Modal(document.querySelector('#profile-remove-modal'));
- this._profileCopyModal = new Modal(document.querySelector('#profile-copy-modal'));
+ this._profileRemoveModal = this._modalController.getModal('profile-remove-modal');
+ this._profileCopyModal = this._modalController.getModal('profile-copy-modal');
this._profileActiveSelect.addEventListener('change', this._onProfileActiveChange.bind(this), false);
this._profileTargetSelect.addEventListener('change', this._onProfileTargetChange.bind(this), false);