mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-10 21:53:13 +08:00
the pace caret will not animate if smooth caret is disabled
This commit is contained in:
parent
4a9f69a4e0
commit
a45bba353b
1 changed files with 24 additions and 9 deletions
|
@ -3746,16 +3746,31 @@ function movePaceCaret() {
|
|||
top: newTop - smoothlinescroll,
|
||||
});
|
||||
|
||||
caret.stop(true, true).animate(
|
||||
{
|
||||
left: newLeft,
|
||||
},
|
||||
paceCaret.spc * 1000,
|
||||
"linear",
|
||||
() => {
|
||||
let duration = paceCaret.spc * 1000;
|
||||
|
||||
if (config.smoothCaret) {
|
||||
caret.stop(true, true).animate(
|
||||
{
|
||||
left: newLeft,
|
||||
},
|
||||
duration,
|
||||
"linear",
|
||||
() => {
|
||||
movePaceCaret();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
caret.stop(true, true).animate(
|
||||
{
|
||||
left: newLeft,
|
||||
},
|
||||
0,
|
||||
"linear"
|
||||
)
|
||||
setTimeout(() => {
|
||||
movePaceCaret();
|
||||
}
|
||||
);
|
||||
},duration)
|
||||
}
|
||||
} catch (e) {
|
||||
// $("#paceCaret").animate({ opacity: 0 }, 250, () => {
|
||||
console.error(e);
|
||||
|
|
Loading…
Reference in a new issue