2
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-04 12:00:17 +00:00

Fix for click on scrollbar in long strip view

Fix for tornado version
This commit is contained in:
Ozzie Isaacs 2023-09-01 07:30:26 +02:00
parent 444ac181f8
commit 7a961c9011
2 changed files with 10 additions and 8 deletions

View File

@ -803,7 +803,7 @@ function init(filename) {
});
// Scrolling up/down will update current image if a new image is into view (for Long Strip Display)
$("#mainContent").scroll(function (event){
$("#mainContent").scroll(function (){
var scroll = $("#mainContent").scrollTop();
var viewLength = 0;
$(".mainImage").each(function(){
@ -815,8 +815,11 @@ function init(filename) {
//Scroll Down
if (currentImage + 1 < imageFiles.length) {
if (currentImageOffset(currentImage + 1) <= 1) {
currentImage++;
console.log(Math.round(imageFiles.length / viewLength * scroll, 0));
currentImage = Math.floor((imageFiles.length) / (viewLength-viewLength/(imageFiles.length)) * scroll, 0);
if ( currentImage >= imageFiles.length) {
currentImage = imageFiles.length - 1;
}
console.log(currentImage);
scrollTocToActive();
updateProgress();
}
@ -825,14 +828,13 @@ function init(filename) {
//Scroll Up
if (currentImage - 1 > -1) {
if (currentImageOffset(currentImage - 1) >= 0) {
currentImage--;
console.log(Math.round(imageFiles.length / viewLength * scroll, 0));
currentImage = Math.floor((imageFiles.length) / (viewLength-viewLength/(imageFiles.length)) * scroll, 0);
console.log(currentImage);
scrollTocToActive();
updateProgress();
}
}
}
// Update scroll position
prevScrollPosition = scroll;
});

View File

@ -24,7 +24,7 @@ from tornado import httputil
from tornado.ioloop import IOLoop
from typing import List, Tuple, Optional, Callable, Any, Dict, Text
from types import TracebackType, FunctionType
from types import TracebackType
import typing
if typing.TYPE_CHECKING:
@ -34,7 +34,7 @@ if typing.TYPE_CHECKING:
class MyWSGIContainer(WSGIContainer):
def __call__(self, request: httputil.HTTPServerRequest) -> None:
if tornado.version_info < (6, 2, 0, 0):
if tornado.version_info < (6, 3, 0, -99):
data = {} # type: Dict[str, Any]
response = [] # type: List[bytes]