Skip to content

Add a new Page scrolling mode (issue 2638, 8952, 10907) #14112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions l10n/en-US/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ cursor_text_select_tool_label=Text Selection Tool
cursor_hand_tool.title=Enable Hand Tool
cursor_hand_tool_label=Hand Tool

scroll_page.title=Use Page Scrolling
scroll_page_label=Page Scrolling
scroll_vertical.title=Use Vertical Scrolling
scroll_vertical_label=Vertical Scrolling
scroll_horizontal.title=Use Horizontal Scrolling
Expand Down
2 changes: 2 additions & 0 deletions l10n/sv-SE/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ cursor_text_select_tool_label=Textmarkeringsverktyg
cursor_hand_tool.title=Aktivera handverktyg
cursor_hand_tool_label=Handverktyg

scroll_page.title=Använd sidrullning
scroll_page_label=Sidrullning
scroll_vertical.title=Använd vertikal rullning
scroll_vertical_label=Vertikal rullning
scroll_horizontal.title=Använd horisontell rullning
Expand Down
14 changes: 11 additions & 3 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import {
animationStarted,
apiPageLayoutToSpreadMode,
apiPageLayoutToViewerModes,
apiPageModeToSidebarView,
AutomationEventBus,
AutoPrintRegExp,
Expand Down Expand Up @@ -1300,8 +1300,16 @@ const PDFViewerApplication = {
if (pageMode && sidebarView === SidebarView.UNKNOWN) {
sidebarView = apiPageModeToSidebarView(pageMode);
}
if (pageLayout && spreadMode === SpreadMode.UNKNOWN) {
spreadMode = apiPageLayoutToSpreadMode(pageLayout);
if (
pageLayout &&
scrollMode === ScrollMode.UNKNOWN &&
spreadMode === SpreadMode.UNKNOWN
) {
const modes = apiPageLayoutToViewerModes(pageLayout);
// TODO: Try to improve page-switching when using the mouse-wheel
// and/or arrow-keys before allowing the document to control this.
// scrollMode = modes.scrollMode;
spreadMode = modes.spreadMode;
}

this.setInitialView(hash, {
Expand Down
Loading