X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6db272cdb367187394dbb01e93e2e03dab14f9ab..f7d8acded4a58d423035c5759f6dee9a34396959:/src/wolnelektury/static/js/book_text/progress.js?ds=sidebyside diff --git a/src/wolnelektury/static/js/book_text/progress.js b/src/wolnelektury/static/js/book_text/progress.js index 8175de666..ae5b14ac4 100644 --- a/src/wolnelektury/static/js/book_text/progress.js +++ b/src/wolnelektury/static/js/book_text/progress.js @@ -1,6 +1,7 @@ (function($){$(function(){ - t = $('#global-progress').data('t'); + let t = $('#global-progress').data('t'); + function upd_t() { $text = $('#main-text #book-text'); texttop = $text.offset().top; @@ -15,7 +16,6 @@ textlen = textbottom - texttop; progress = (window.scrollY - texttop) / textlen; progress = Math.max(0, Math.min(progress, 1)) - console.log('SCROLL BODY', progress); $('#global-progress .filled').css('right', (1 - progress) * 100 + '%'); tleft = Math.round((1 - progress) * t / 60);