提交 7a0e36e4 编写于 作者: J Johan Preynat

Don't reset scroll at init for anchors

上级 295b0bdd
......@@ -331,9 +331,13 @@ function preparePage(resetScroll) {
// Focus on content
$pageWrapper.focus();
// Get scroller
var $scroller = getScroller();
// Reset scroll
if (resetScroll !== false) $bookInner.scrollTop(0);
$bookBody.scrollTop(0);
if (resetScroll !== false) {
$scroller.scrollTop(0);
}
// Get current page summary chapters
$chapters = $('.book-summary .summary .chapter')
......@@ -354,7 +358,6 @@ function preparePage(resetScroll) {
});
// Bind scrolling if summary contains more than one link to this page
var $scroller = getScroller();
if ($chapters.length > 1) {
$scroller.scroll(handleScrolling);
}
......@@ -428,7 +431,7 @@ function init() {
$(window).resize(updateNavigationPosition);
// Prepare current page
preparePage();
preparePage(false);
}
module.exports = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册