mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 12:19:46 -04:00
Fixes to scrolling algorithm for IE11
Former-commit-id: ed325c04c22db645bc20de67bed2be97588eb3a7 [formerly be8db5350a7a0c980554e2c6e89bbf4d8c6ecc98] Former-commit-id: fa393251bde6e9b6726101e0cc82c11d121cc154
This commit is contained in:
parent
87f28083b2
commit
5eb89721ff
@ -256,7 +256,7 @@
|
||||
</nav>
|
||||
</header>
|
||||
<article class="view-content" id="article">
|
||||
<div id="scrollbox" class="container" style="position:relative;z-index:-2;overflow:auto;width:100%;">
|
||||
<div id="scrollbox" class="container" style="position:relative;overflow:auto;width:100%;">
|
||||
<div id="about" style="display: none;" class="category-padding">
|
||||
<div class="returntoArticle" style="text-align:center;padding-top:30px;"></div>
|
||||
<h2>
|
||||
|
@ -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";
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user