fix preview frame error

This commit is contained in:
siikamiika 2020-04-10 16:06:22 +03:00
parent 565e3a8c6a
commit 275f455e73

View File

@ -26,7 +26,7 @@
*/ */
class Frontend extends TextScanner { class Frontend extends TextScanner {
constructor(popup, initEventDispatcher) { constructor(popup, initEventDispatcher=null) {
super( super(
window, window,
() => this.popup.isProxy() ? [] : [this.popup.getContainer()], () => this.popup.isProxy() ? [] : [this.popup.getContainer()],
@ -77,8 +77,10 @@ class Frontend extends TextScanner {
window.visualViewport.addEventListener('resize', this.onVisualViewportResize.bind(this)); window.visualViewport.addEventListener('resize', this.onVisualViewportResize.bind(this));
} }
this.initEventDispatcher.on('setDisabledOverride', this.onSetDisabledOverride.bind(this)); if (this.initEventDispatcher !== null) {
this.initEventDispatcher.on('popupChange', this.onPopupChange.bind(this)); 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('orphaned', this.onOrphaned.bind(this));
yomichan.on('optionsUpdated', this.updateOptions.bind(this)); yomichan.on('optionsUpdated', this.updateOptions.bind(this));