1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Extract Scroll Indicator controller

This commit is contained in:
Yassine Guedidi 2025-03-02 12:59:15 +01:00
parent 503b82ea13
commit 019d252446
3 changed files with 11 additions and 15 deletions

View file

@ -242,22 +242,8 @@ const stickyNav = () => {
});
};
const articleScroll = () => {
const articleEl = $('#article');
if (articleEl.length > 0) {
$(window).scroll(() => {
const s = $(window).scrollTop();
const d = $(document).height();
const c = $(window).height();
const scrollPercent = (s / (d - c)) * 100;
$('.progress .determinate').css('width', `${scrollPercent}%`);
});
}
};
$(document).ready(() => {
stickyNav();
articleScroll();
initPreviewText();
const toggleNav = (toShow, toFocus) => {