diff --git a/static/balance.js b/static/balance.js index bfecb8b..d7a6b5e 100644 --- a/static/balance.js +++ b/static/balance.js @@ -90,6 +90,8 @@ function fastPosChanged() { function balance(){ + cont = document.getElementById("response-container") + cont.innerHTML = "" sides = ["left", "right"] blue = [ "", "", "", "", ""] @@ -129,6 +131,8 @@ function balance(){ jsonData = JSON.stringify(dictAll, null, 4); /* transmitt */ + spinner = document.getElementById("loading") + spinner.style.display = "block"; fetch(window.location.href, { method: 'post', headers: { @@ -136,7 +140,7 @@ function balance(){ 'Content-Type': 'application/json' }, body: jsonData }).then(r => r.json()).then(j => { - cont = document.getElementById("response-container") + spinner.style.display = "none"; cont.innerHTML = j["content"] }) diff --git a/templates/json_builder.html b/templates/json_builder.html index 49548fb..c132e55 100644 --- a/templates/json_builder.html +++ b/templates/json_builder.html @@ -18,6 +18,9 @@ +