Skip to content

Commit

Permalink
Default to odd spread mode in wide screen
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Apr 22, 2024
1 parent 078d42a commit 86bf813
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,11 @@ const PDFViewerApplication = {
let scrollMode = AppOptions.get("scrollModeOnLoad");
let spreadMode = AppOptions.get("spreadModeOnLoad");

if (spreadMode === SpreadMode.UNKNOWN) {
spreadMode =
innerWidth > innerHeight ? SpreadMode.ODD : SpreadMode.NONE;
}

if (stored?.page && viewOnLoad !== ViewOnLoad.INITIAL) {
hash =
`page=${stored.page}&zoom=${zoom || stored.zoom},` +
Expand All @@ -1319,7 +1324,7 @@ const PDFViewerApplication = {
if (scrollMode === ScrollMode.UNKNOWN) {
scrollMode = stored.scrollMode | 0;
}
if (spreadMode === SpreadMode.UNKNOWN) {
if (stored.spreadMode) {
spreadMode = stored.spreadMode | 0;
}
}
Expand Down

0 comments on commit 86bf813

Please sign in to comment.