aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend-initialize.js
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-11 15:32:04 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-11 21:04:30 +0300
commitd93e3e1a6727e23547c44d4fc3b82244f560c459 (patch)
treec76d8871ca94499fd292280f64a2378d4b9fda07 /ext/fg/js/frontend-initialize.js
parent275f455e73c48294aeefd6c02959b1ddd3cbf4e8 (diff)
use setters instead of EventDispatcher
Diffstat (limited to 'ext/fg/js/frontend-initialize.js')
-rw-r--r--ext/fg/js/frontend-initialize.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/ext/fg/js/frontend-initialize.js b/ext/fg/js/frontend-initialize.js
index ce1a6bf6..34be6bc6 100644
--- a/ext/fg/js/frontend-initialize.js
+++ b/ext/fg/js/frontend-initialize.js
@@ -73,8 +73,6 @@ async function main() {
const isIframe = !proxy && (window !== window.parent);
- const initEventDispatcher = new EventDispatcher();
-
const popups = {
iframe: null,
proxy: null,
@@ -99,18 +97,18 @@ async function main() {
popups.normal = popup;
}
- if (isSearchPage) {
- const disabled = !options.scanning.enableOnSearchPage;
- initEventDispatcher.trigger('setDisabledOverride', {disabled});
- }
-
- if (isIframe) {
- initEventDispatcher.trigger('popupChange', {popup});
- }
-
if (frontend === null) {
- frontend = new Frontend(popup, initEventDispatcher);
+ frontend = new Frontend(popup);
await frontend.prepare();
+ } else {
+ if (isSearchPage) {
+ const disabled = !options.scanning.enableOnSearchPage;
+ frontend.setDisabledOverride(disabled);
+ }
+
+ if (isIframe) {
+ await frontend.setPopup(popup);
+ }
}
};