diff --git a/www/js/app.js b/www/js/app.js
index 649c7195..4e3d0b08 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -937,13 +937,13 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
var scrollFunction = function () {
damper--;
- newScrollY = iframe.contentWindow.scrollY;
+ if (damper > 0) return;
+ newScrollY = iframe.contentWindow.pageYOffset;
var prefix = document.getElementById('prefix');
var findInArticle = document.getElementById('findInArticle');
// Hide the toolbars if user has scrolled and search elements are not selected
if (newScrollY - oldScrollY > 0 && document.activeElement !== prefix
&& document.activeElement !== findInArticle) {
- if (damper > 0) return;
// If the header and/or footer have not already been hidden
if (/\(0p?x?\)/.test(header.style.transform)) {
setTimeout(function() {
@@ -965,16 +965,17 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'images', 'cooki
}
}, 200);
}
- } else {
+ } else if (newScrollY - oldScrollY < 0) {
header.style.zIndex = 1;
header.style.transform = 'translateY(0)';
footer.style.transform = 'translateY(0)';
}
oldScrollY = newScrollY;
+ damper = 10;
};
function checkToolbar() {
- oldScrollY = iframe.contentWindow.scrollY;
+ oldScrollY = iframe.contentWindow.pageYOffset;
navbarDim = document.getElementById('navbar').getBoundingClientRect();
footerDim = footer.getBoundingClientRect();
header.style.transition = "transform 500ms";
diff --git a/www/js/init.js b/www/js/init.js
index d7404a9f..9e9b1d66 100644
--- a/www/js/init.js
+++ b/www/js/init.js
@@ -31,7 +31,7 @@ window.onerror = function (msg, url) {
var state = {};
// Parameters that define overall operation of app
var params = {};
-params['version'] = "0.9.9.96 Beta"; //DEV: This value is compared to the cookie "version" in order to show first-time info, and the cookie is updated in app.js
+params['version'] = "0.9.9.97-WIP Beta"; //DEV: This value is compared to the cookie "version" in order to show first-time info, and the cookie is updated in app.js
params['packagedFile'] = "wikipedia_en_ray_charles.zim"; //For packaged Kiwix JS (e.g. with Wikivoyage file), set this to the filename (for split files, give the first chunk *.zimaa) and place file(s) in default storage
params['archivePath'] = "archive"; //The directory containing the packaged archive(s) (relative to app's root directory)
params['fileVersion'] = "wikipedia_en_ray_charles_maxi_2019-08.zim (14-Aug-2019)"; //Use generic name for actual file, and give version here