summaryrefslogtreecommitdiffstats
path: root/theme/javascript/core
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-03-24 23:52:41 +0100
committerSamy Pessé <samypesse@gmail.com>2015-03-24 23:52:41 +0100
commitf640e101ba4f769d55934d13893d95269f5b22c9 (patch)
tree5b17cacf4f72f0a42ad730ce01d62e6081672013 /theme/javascript/core
parentb7da276ae034d22e34ec92b3d8332f0558b97499 (diff)
downloadgitbook-f640e101ba4f769d55934d13893d95269f5b22c9.zip
gitbook-f640e101ba4f769d55934d13893d95269f5b22c9.tar.gz
gitbook-f640e101ba4f769d55934d13893d95269f5b22c9.tar.bz2
Fix scroling position when preparing page
Diffstat (limited to 'theme/javascript/core')
-rwxr-xr-xtheme/javascript/core/navigation.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/theme/javascript/core/navigation.js b/theme/javascript/core/navigation.js
index 947f4db..c6a33b4 100755
--- a/theme/javascript/core/navigation.js
+++ b/theme/javascript/core/navigation.js
@@ -72,6 +72,7 @@ define([
};
var preparePage = function() {
+ var $bodyInner = $(".book-body .body-inner");
var $pageWrapper = $(".book-body .page-wrapper");
// Show progress
@@ -80,12 +81,12 @@ define([
// Update navigation position
updateNavigationPosition();
- // Reset scroll
- $pageWrapper.scrollTop(0);
-
// Focus on content
$pageWrapper.focus();
+ // Reset scroll
+ $bodyInner.scrollTop(0);
+
// Notify
events.trigger("page.change");
};