summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/modal-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/settings/modal-controller.js')
-rw-r--r--ext/bg/js/settings/modal-controller.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/ext/bg/js/settings/modal-controller.js b/ext/bg/js/settings/modal-controller.js
index d604b050..8e551564 100644
--- a/ext/bg/js/settings/modal-controller.js
+++ b/ext/bg/js/settings/modal-controller.js
@@ -26,20 +26,13 @@ class ModalController {
}
prepare() {
- for (const node of document.querySelectorAll('.modal')) {
+ for (const node of document.querySelectorAll('.modal,.modal-container')) {
const {id} = node;
const modal = new Modal(node);
+ modal.prepare();
this._modalMap.set(id, modal);
this._modals.push(modal);
}
-
- for (const node of document.querySelectorAll('.modal-container')) {
- const {id} = node;
- const modal = new Modal(node);
- this._modalMap.set(id, modal);
- this._modals.push(modal);
- node.addEventListener('click', this._onModalContainerClick.bind(this, modal), false);
- }
}
getModal(name) {
@@ -56,11 +49,4 @@ class ModalController {
}
return null;
}
-
- // Private
-
- _onModalContainerClick(modal, e) {
- if (e.currentTarget !== e.target) { return; }
- modal.setVisible(false);
- }
}