mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Don't attempt to modify the DOM and/or trigger rendering when changing Scroll/Spread modes without a PDF document being loaded
This commit is contained in:
parent
05f682cd4b
commit
d3cb5e7117
1 changed files with 6 additions and 0 deletions
|
@ -103,6 +103,9 @@ class PDFViewer extends BaseViewer {
|
|||
this.eventBus.dispatch('scrollmodechanged', { mode, });
|
||||
this._updateScrollModeClasses();
|
||||
|
||||
if (!this.pdfDocument) {
|
||||
return;
|
||||
}
|
||||
const pageNumber = this._currentPageNumber;
|
||||
// Non-numeric scale modes can be sensitive to the scroll orientation.
|
||||
// Call this before re-scrolling to the current page, to ensure that any
|
||||
|
@ -140,6 +143,9 @@ class PDFViewer extends BaseViewer {
|
|||
}
|
||||
|
||||
_regroupSpreads() {
|
||||
if (!this.pdfDocument) {
|
||||
return;
|
||||
}
|
||||
const viewer = this.viewer, pages = this._pages;
|
||||
// Temporarily remove all the pages from the DOM.
|
||||
viewer.textContent = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue