mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Replace setScrollMode
/setSpreadMode
methods with getters/setters
Since all the other viewer methods use the getter/setter pattern, e.g. for setting page/scale/rotation, the way that the Scroll/Spread modes are set thus stands out. For consistency, this really ought to use the same pattern as the rest of the `BaseViewer`. (To avoid breaking third-party implementations, the old methods are kept around as aliases.)
This commit is contained in:
parent
9515f579c6
commit
a7ac27e385
3 changed files with 63 additions and 39 deletions
|
@ -1250,10 +1250,10 @@ let PDFViewerApplication = {
|
|||
};
|
||||
let setViewerModes = (scroll, spread) => {
|
||||
if (Number.isInteger(scroll)) {
|
||||
this.pdfViewer.setScrollMode(scroll);
|
||||
this.pdfViewer.scrollMode = scroll;
|
||||
}
|
||||
if (Number.isInteger(spread)) {
|
||||
this.pdfViewer.setSpreadMode(spread);
|
||||
this.pdfViewer.spreadMode = spread;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2019,10 +2019,10 @@ function webViewerRotateCcw() {
|
|||
PDFViewerApplication.rotatePages(-90);
|
||||
}
|
||||
function webViewerSwitchScrollMode(evt) {
|
||||
PDFViewerApplication.pdfViewer.setScrollMode(evt.mode);
|
||||
PDFViewerApplication.pdfViewer.scrollMode = evt.mode;
|
||||
}
|
||||
function webViewerSwitchSpreadMode(evt) {
|
||||
PDFViewerApplication.pdfViewer.setSpreadMode(evt.mode);
|
||||
PDFViewerApplication.pdfViewer.spreadMode = evt.mode;
|
||||
}
|
||||
function webViewerDocumentProperties() {
|
||||
PDFViewerApplication.pdfDocumentProperties.open();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue