mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[GeckoView] Ignore Scroll/Spread-modes in the PDFViewer
setters
Rather than sprinkling pre-processor statements throughout the viewer-code, simply "disable" the relevant `PDFViewer` setters instead. Also, given that the GeckoView-specific viewer doesn't have a sidebar we don't actually need to explicitly ignore a `pageMode` during loading.
This commit is contained in:
parent
03059e1f86
commit
cca299eeb9
3 changed files with 32 additions and 30 deletions
|
@ -265,21 +265,13 @@ class PDFScriptingManager {
|
|||
case "error":
|
||||
console.error(value);
|
||||
break;
|
||||
case "layout": {
|
||||
// NOTE: Always ignore the pageLayout in GeckoView since there's
|
||||
// no UI available to change Scroll/Spread modes for the user.
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined"
|
||||
? window.isGECKOVIEW
|
||||
: PDFJSDev.test("GECKOVIEW")) ||
|
||||
isInPresentationMode
|
||||
) {
|
||||
case "layout":
|
||||
if (isInPresentationMode) {
|
||||
return;
|
||||
}
|
||||
const modes = apiPageLayoutToViewerModes(value);
|
||||
this._pdfViewer.spreadMode = modes.spreadMode;
|
||||
break;
|
||||
}
|
||||
case "page-num":
|
||||
this._pdfViewer.currentPageNumber = value + 1;
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue