fixed heatmap not loading at first

This commit is contained in:
Jack 2021-07-24 19:58:11 +01:00
parent 97cc440e22
commit 9d6ff9fb35
2 changed files with 13 additions and 2 deletions

View file

@ -2014,7 +2014,7 @@ export function finish(difficultyFailed = false) {
$("#words").empty();
ChartController.result.resize();
if (Config.burstHeatmap) {
if (Config.alwaysShowWordsHistory && Config.burstHeatmap) {
TestUI.applyBurstHeatmap();
}
$("#testModesNotice").addClass("hidden");

View file

@ -16,6 +16,7 @@ import * as PractiseWords from "./practise-words";
import * as Replay from "./replay";
import * as TestStats from "./test-stats";
import * as Misc from "./misc";
import * as TestUI from "./test-ui";
export let currentWordElementIndex = 0;
export let resultVisible = false;
@ -770,12 +771,22 @@ export function toggleResultWords() {
`<div class="preloader"><i class="fas fa-fw fa-spin fa-circle-notch"></i></div>`
);
loadWordsHistory().then(() => {
if (Config.burstHeatmap) {
TestUI.applyBurstHeatmap();
}
$("#resultWordsHistory")
.removeClass("hidden")
.css("display", "none")
.slideDown(250);
.slideDown(250, () => {
if (Config.burstHeatmap) {
TestUI.applyBurstHeatmap();
}
});
});
} else {
if (Config.burstHeatmap) {
TestUI.applyBurstHeatmap();
}
$("#resultWordsHistory")
.removeClass("hidden")
.css("display", "none")