Skip to content

Commit e504e81

Browse files
Merge pull request #14112 from Snuffleupagus/ScrollMode-PAGE
Add a new Page scrolling mode (issue 2638, 8952, 10907)
2 parents ed3da19 + e1a2e91 commit e504e81

15 files changed

+303
-270
lines changed

l10n/en-US/viewer.properties

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ cursor_text_select_tool_label=Text Selection Tool
6161
cursor_hand_tool.title=Enable Hand Tool
6262
cursor_hand_tool_label=Hand Tool
6363

64+
scroll_page.title=Use Page Scrolling
65+
scroll_page_label=Page Scrolling
6466
scroll_vertical.title=Use Vertical Scrolling
6567
scroll_vertical_label=Vertical Scrolling
6668
scroll_horizontal.title=Use Horizontal Scrolling

l10n/sv-SE/viewer.properties

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ cursor_text_select_tool_label=Textmarkeringsverktyg
6161
cursor_hand_tool.title=Aktivera handverktyg
6262
cursor_hand_tool_label=Handverktyg
6363

64+
scroll_page.title=Använd sidrullning
65+
scroll_page_label=Sidrullning
6466
scroll_vertical.title=Använd vertikal rullning
6567
scroll_vertical_label=Vertikal rullning
6668
scroll_horizontal.title=Använd horisontell rullning

web/app.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import {
1818
animationStarted,
19-
apiPageLayoutToSpreadMode,
19+
apiPageLayoutToViewerModes,
2020
apiPageModeToSidebarView,
2121
AutomationEventBus,
2222
AutoPrintRegExp,
@@ -1300,8 +1300,16 @@ const PDFViewerApplication = {
13001300
if (pageMode && sidebarView === SidebarView.UNKNOWN) {
13011301
sidebarView = apiPageModeToSidebarView(pageMode);
13021302
}
1303-
if (pageLayout && spreadMode === SpreadMode.UNKNOWN) {
1304-
spreadMode = apiPageLayoutToSpreadMode(pageLayout);
1303+
if (
1304+
pageLayout &&
1305+
scrollMode === ScrollMode.UNKNOWN &&
1306+
spreadMode === SpreadMode.UNKNOWN
1307+
) {
1308+
const modes = apiPageLayoutToViewerModes(pageLayout);
1309+
// TODO: Try to improve page-switching when using the mouse-wheel
1310+
// and/or arrow-keys before allowing the document to control this.
1311+
// scrollMode = modes.scrollMode;
1312+
spreadMode = modes.spreadMode;
13051313
}
13061314

13071315
this.setInitialView(hash, {

0 commit comments

Comments
 (0)