Skip to content

Commit af78d31

Browse files
authored
Scroll to top when navigating to locators in scroll mode (readium#384)
1 parent 85ccb5b commit af78d31

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

readium/navigator/src/main/assets/_scripts/src/utils.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ function scrollToRange(range) {
144144

145145
function scrollToRect(rect) {
146146
if (isScrollModeEnabled()) {
147-
document.scrollingElement.scrollTop =
148-
rect.top + window.scrollY - window.innerHeight / 2;
147+
document.scrollingElement.scrollTop = rect.top + window.scrollY;
149148
} else {
150149
document.scrollingElement.scrollLeft = snapOffset(
151150
rect.left + window.scrollX

readium/navigator/src/main/assets/readium/scripts/readium-fixed.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readium/navigator/src/main/assets/readium/scripts/readium-reflowable.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)