aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-04-10 16:06:22 +0300
committersiikamiika <siikamiika@users.noreply.github.com>2020-04-11 21:04:30 +0300
commit275f455e73c48294aeefd6c02959b1ddd3cbf4e8 (patch)
tree15319657f95429e37541042567e5ec3df1aaeb6b
parent565e3a8c6ad31afa0ddb171ac5a33b6b84e5c3dc (diff)
fix preview frame error
-rw-r--r--ext/fg/js/frontend.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index f969df32..cd811115 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -26,7 +26,7 @@
*/
class Frontend extends TextScanner {
- constructor(popup, initEventDispatcher) {
+ constructor(popup, initEventDispatcher=null) {
super(
window,
() => this.popup.isProxy() ? [] : [this.popup.getContainer()],
@@ -77,8 +77,10 @@ class Frontend extends TextScanner {
window.visualViewport.addEventListener('resize', this.onVisualViewportResize.bind(this));
}
- this.initEventDispatcher.on('setDisabledOverride', this.onSetDisabledOverride.bind(this));
- this.initEventDispatcher.on('popupChange', this.onPopupChange.bind(this));
+ if (this.initEventDispatcher !== null) {
+ this.initEventDispatcher.on('setDisabledOverride', this.onSetDisabledOverride.bind(this));
+ this.initEventDispatcher.on('popupChange', this.onPopupChange.bind(this));
+ }
yomichan.on('orphaned', this.onOrphaned.bind(this));
yomichan.on('optionsUpdated', this.updateOptions.bind(this));