mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-28 04:19:59 +00:00
Fix for click on scrollbar in long strip view
Fix for tornado version
This commit is contained in:
parent
444ac181f8
commit
7a961c9011
@ -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)
|
// 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 scroll = $("#mainContent").scrollTop();
|
||||||
var viewLength = 0;
|
var viewLength = 0;
|
||||||
$(".mainImage").each(function(){
|
$(".mainImage").each(function(){
|
||||||
@ -815,8 +815,11 @@ function init(filename) {
|
|||||||
//Scroll Down
|
//Scroll Down
|
||||||
if (currentImage + 1 < imageFiles.length) {
|
if (currentImage + 1 < imageFiles.length) {
|
||||||
if (currentImageOffset(currentImage + 1) <= 1) {
|
if (currentImageOffset(currentImage + 1) <= 1) {
|
||||||
currentImage++;
|
currentImage = Math.floor((imageFiles.length) / (viewLength-viewLength/(imageFiles.length)) * scroll, 0);
|
||||||
console.log(Math.round(imageFiles.length / viewLength * scroll, 0));
|
if ( currentImage >= imageFiles.length) {
|
||||||
|
currentImage = imageFiles.length - 1;
|
||||||
|
}
|
||||||
|
console.log(currentImage);
|
||||||
scrollTocToActive();
|
scrollTocToActive();
|
||||||
updateProgress();
|
updateProgress();
|
||||||
}
|
}
|
||||||
@ -825,14 +828,13 @@ function init(filename) {
|
|||||||
//Scroll Up
|
//Scroll Up
|
||||||
if (currentImage - 1 > -1) {
|
if (currentImage - 1 > -1) {
|
||||||
if (currentImageOffset(currentImage - 1) >= 0) {
|
if (currentImageOffset(currentImage - 1) >= 0) {
|
||||||
currentImage--;
|
currentImage = Math.floor((imageFiles.length) / (viewLength-viewLength/(imageFiles.length)) * scroll, 0);
|
||||||
console.log(Math.round(imageFiles.length / viewLength * scroll, 0));
|
console.log(currentImage);
|
||||||
scrollTocToActive();
|
scrollTocToActive();
|
||||||
updateProgress();
|
updateProgress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update scroll position
|
// Update scroll position
|
||||||
prevScrollPosition = scroll;
|
prevScrollPosition = scroll;
|
||||||
});
|
});
|
||||||
|
@ -24,7 +24,7 @@ from tornado import httputil
|
|||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
|
|
||||||
from typing import List, Tuple, Optional, Callable, Any, Dict, Text
|
from typing import List, Tuple, Optional, Callable, Any, Dict, Text
|
||||||
from types import TracebackType, FunctionType
|
from types import TracebackType
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
if typing.TYPE_CHECKING:
|
if typing.TYPE_CHECKING:
|
||||||
@ -34,7 +34,7 @@ if typing.TYPE_CHECKING:
|
|||||||
class MyWSGIContainer(WSGIContainer):
|
class MyWSGIContainer(WSGIContainer):
|
||||||
|
|
||||||
def __call__(self, request: httputil.HTTPServerRequest) -> None:
|
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]
|
data = {} # type: Dict[str, Any]
|
||||||
response = [] # type: List[bytes]
|
response = [] # type: List[bytes]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user