summaryrefslogtreecommitdiffstats
path: root/theme/javascript/core
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-15 17:42:46 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-15 17:42:46 +0200
commit95f9ae83d019413ce134cb0771c1c3d5af7eda44 (patch)
treef82f9eca50ad56faf2d391e0052b1b159b146205 /theme/javascript/core
parent93042893157b78b268a9ab4078cde31f4d78e6f5 (diff)
downloadgitbook-95f9ae83d019413ce134cb0771c1c3d5af7eda44.zip
gitbook-95f9ae83d019413ce134cb0771c1c3d5af7eda44.tar.gz
gitbook-95f9ae83d019413ce134cb0771c1c3d5af7eda44.tar.bz2
Fix #97: keep scroll position during page changement
Diffstat (limited to 'theme/javascript/core')
-rwxr-xr-xtheme/javascript/core/navigation.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/theme/javascript/core/navigation.js b/theme/javascript/core/navigation.js
index 9f7f528..84445b4 100755
--- a/theme/javascript/core/navigation.js
+++ b/theme/javascript/core/navigation.js
@@ -38,10 +38,14 @@ define([
});
$("head").html(headContent);
- // Update header, body and summary
+ // Update header, body
$('.book-header').html($page.find('.book-header').html());
$('.book-body').html($page.find('.book-body').html());
+
+ // Update summary
+ var scrollPosition = $('.book-summary .summary').scrollTop();
$('.book-summary').html($page.find('.book-summary').html());
+ $('.book-summary .summary').scrollTop(scrollPosition);
// Update state
state.update($page);