mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Merge pull request #7652 from Snuffleupagus/resize-event-handler-prevent-error-before-eventBus-initialized
Prevent errors if the 'resize' event is fired before the `eventBus` has been initialized
This commit is contained in:
commit
431af8cf85
1 changed files with 3 additions and 0 deletions
|
@ -1803,6 +1803,9 @@ function webViewerUpdateViewarea(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('resize', function webViewerResize(evt) {
|
window.addEventListener('resize', function webViewerResize(evt) {
|
||||||
|
if (!PDFViewerApplication.eventBus) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
PDFViewerApplication.eventBus.dispatch('resize');
|
PDFViewerApplication.eventBus.dispatch('resize');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue