mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
修复web阅读翻页动画未完成时再次触发翻页导致页面抽搐的问题
This commit is contained in:
parent
c1facb5f72
commit
07d294ac04
@ -403,8 +403,10 @@ const onReachBottom = (entries) => {
|
||||
}
|
||||
};
|
||||
|
||||
let canJump = true;
|
||||
// 监听方向键
|
||||
const handleKeyPress = (event) => {
|
||||
if (!canJump) return;
|
||||
switch (event.key) {
|
||||
case "ArrowLeft":
|
||||
event.stopPropagation();
|
||||
@ -425,8 +427,10 @@ const handleKeyPress = (event) => {
|
||||
type: "warn",
|
||||
});
|
||||
} else {
|
||||
canJump = false;
|
||||
jump(0 - document.documentElement.clientHeight + 100, {
|
||||
duration: store.config.jumpDuration,
|
||||
callback: () => (canJump = true),
|
||||
});
|
||||
}
|
||||
break;
|
||||
@ -443,8 +447,10 @@ const handleKeyPress = (event) => {
|
||||
type: "warn",
|
||||
});
|
||||
} else {
|
||||
canJump = false;
|
||||
jump(document.documentElement.clientHeight - 100, {
|
||||
duration: store.config.jumpDuration,
|
||||
callback: () => (canJump = true),
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user