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:
@@ -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')
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user