add a Loading indicator to show fetching data in progress

This commit is contained in:
Tim Fry
2024-12-13 16:45:02 -04:00
parent 847dbb23b5
commit 29962bb4b2
2 changed files with 12 additions and 0 deletions
@@ -41,6 +41,14 @@ document.addEventListener("DOMContentLoaded", async function () {
add_draggable_rows();
});
function remove_loading() {
//remove loading
const loading = document.getElementById('loading');
if (loading) {
loading.remove();
}
}
async function fetch_data(command) {
try {
const response = await fetch('phrase_responder.php', {
@@ -104,6 +112,8 @@ async function add_existing() {
select_action.dispatchEvent(changeEvent);
}
}
remove_loading();
}
//