showing mistake count when hovering over the accuracy number

This commit is contained in:
Miodec 2023-03-17 12:06:57 +01:00
parent ac0ba93a8c
commit d0ee9502e1

View file

@ -255,7 +255,14 @@ function updateWpmAndAcc(): void {
}
$("#result .stats .time .bottom .text").text(time);
$("#result .stats .raw .bottom").removeAttr("aria-label");
$("#result .stats .acc .bottom").removeAttr("aria-label");
// $("#result .stats .acc .bottom").removeAttr("aria-label");
$("#result .stats .acc .bottom").attr(
"aria-label",
`${TestInput.accuracy.incorrect} mistake${
TestInput.accuracy.incorrect == 1 ? "" : "s"
}`
);
} else {
//not showing decimal places
if (Config.alwaysShowCPM == false) {
@ -287,7 +294,12 @@ function updateWpmAndAcc(): void {
}
$("#result .stats .acc .bottom").text(Math.floor(result.acc) + "%");
$("#result .stats .acc .bottom").attr("aria-label", result.acc + "%");
$("#result .stats .acc .bottom").attr(
"aria-label",
`${result.acc}% (${TestInput.accuracy.incorrect} mistake${
TestInput.accuracy.incorrect == 1 ? "" : "s"
})`
);
}
}