Show all texts at once; hide them while the results are being fetched; show them after the results have been fetched

This commit is contained in:
2025-03-16 22:15:25 -04:00
parent 38316b0ea9
commit 0e26b2345a
2 changed files with 10 additions and 2 deletions

View File

@@ -1,3 +1,7 @@
function hideText(request) {
document.querySelectorAll(".languageText, .romanizationText").forEach(element => element.style.visibility = 'hidden')
}
function updateTranslations(response) {
const translations = JSON.parse(response);
document.querySelectorAll(".languageText").forEach(element => {
@@ -23,5 +27,7 @@ function updateTranslations(response) {
element.textContent = "(" + romanizations[element.id.replace("Romanization", "")] + ")";
}
});
// Show elements again
document.querySelectorAll(".languageText, .romanizationText").forEach(element => element.style.visibility = 'visible')
});
}