Skip to content

Commit

Permalink
Merge pull request mozilla#7652 from Snuffleupagus/resize-event-handl…
Browse files Browse the repository at this point in the history
…er-prevent-error-before-eventBus-initialized

Prevent errors if the 'resize' event is fired before the `eventBus` has been initialized
  • Loading branch information
yurydelendik committed Sep 21, 2016
2 parents 15e1ae4 + 1a2f142 commit 431af8c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,9 @@ function webViewerUpdateViewarea(e) {
}

window.addEventListener('resize', function webViewerResize(evt) {
if (!PDFViewerApplication.eventBus) {
return;
}
PDFViewerApplication.eventBus.dispatch('resize');
});

Expand Down

0 comments on commit 431af8c

Please sign in to comment.