Fix scroll reset on small resolutions (mobile & tablet)

This commit is contained in:
Samy Pessé
2015-03-24 23:59:03 +01:00
parent f640e101ba
commit f42e48be03
2 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -72,8 +72,9 @@ define([
};
var preparePage = function() {
var $bodyInner = $(".book-body .body-inner");
var $pageWrapper = $(".book-body .page-wrapper");
var $bookBody = $(".book-body");
var $bookInner = $bookBody.find(".body-inner");
var $pageWrapper = $bookInner.find(".page-wrapper");
// Show progress
progress.show();
@@ -85,7 +86,8 @@ define([
$pageWrapper.focus();
// Reset scroll
$bodyInner.scrollTop(0);
$bookInner.scrollTop(0);
$bookBody.scrollTop(0);
// Notify
events.trigger("page.change");