mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Remove PDFThumbnailViewer_ensureThumbnailVisible
Functionality wise, `ensureThumbnailVisible` is essentially just a shorthand for `scrollThumbnailIntoView`. (And note that `PDFViewer` doesn't implement a `ensurePageVisible` method.) The only remaining usage of `PDFThumbnailViewer_ensureThumbnailVisible` is inside `PDFPresentationMode`, which introduces an otherwise unnecessary `PDFThumbnailViewer` dependency there. We're already relying on the `presentationmodechanged` event, in various files, to track the state of Presentation Mode. Thus we can simply listen for that event in `PDFSidebar` too, and update the thumbnails if necessary.
This commit is contained in:
parent
9ff6c83bb6
commit
39cba5d25d
4 changed files with 8 additions and 15 deletions
|
@ -25,8 +25,6 @@ var CONTROLS_SELECTOR = 'pdfPresentationModeControls';
|
|||
* @property {HTMLDivElement} container - The container for the viewer element.
|
||||
* @property {HTMLDivElement} viewer - (optional) The viewer element.
|
||||
* @property {PDFViewer} pdfViewer - The document viewer.
|
||||
* @property {PDFThumbnailViewer} pdfThumbnailViewer - (optional) The thumbnail
|
||||
* viewer.
|
||||
* @property {Array} contextMenuItems - (optional) The menuitems that are added
|
||||
* to the context menu in Presentation Mode.
|
||||
*/
|
||||
|
@ -43,7 +41,6 @@ var PDFPresentationMode = (function PDFPresentationModeClosure() {
|
|||
this.container = options.container;
|
||||
this.viewer = options.viewer || options.container.firstElementChild;
|
||||
this.pdfViewer = options.pdfViewer;
|
||||
this.pdfThumbnailViewer = options.pdfThumbnailViewer || null;
|
||||
var contextMenuItems = options.contextMenuItems || null;
|
||||
|
||||
this.active = false;
|
||||
|
@ -245,10 +242,6 @@ var PDFPresentationMode = (function PDFPresentationModeClosure() {
|
|||
this._resetMouseScrollState();
|
||||
this.container.removeAttribute('contextmenu');
|
||||
this.contextMenuOpen = false;
|
||||
|
||||
if (this.pdfThumbnailViewer) {
|
||||
this.pdfThumbnailViewer.ensureThumbnailVisible(page);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue