Re-factor the isPageVisible-handling in the find-controller (PR 10217 follow-up)

The way that this was implemented in PR 10217 has always bothered me slightly, since the `isPageVisible`-method that I introduced there always felt quite out-of-place in the `IPDFLinkService`-implementations.
Hence this is instead replaced by a callback-function in `PDFFindController`, to handle the page-visibility checks. Note that since the `PDFViewer`-constructor always sets this callback-function, e.g. the viewer-component examples still work as-is.
This commit is contained in:
Jonas Jenwald 2023-05-26 10:31:54 +02:00
parent cbc4b20b12
commit d0bf505312
4 changed files with 14 additions and 45 deletions

View file

@ -569,13 +569,6 @@ class PDFLinkService {
return this.#pagesRefCache.get(refStr) || null;
}
/**
* @param {number} pageNumber
*/
isPageVisible(pageNumber) {
return this.pdfViewer.isPageVisible(pageNumber);
}
/**
* @param {number} pageNumber
*/
@ -745,13 +738,6 @@ class SimpleLinkService {
*/
cachePageRef(pageNum, pageRef) {}
/**
* @param {number} pageNumber
*/
isPageVisible(pageNumber) {
return true;
}
/**
* @param {number} pageNumber
*/