Display loading animation when updating the heatmap

This commit is contained in:
Starbeamrainbowlabs 2019-06-30 18:48:31 +01:00
parent 7eb3519319
commit 58d40f8f4e
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 7 additions and 3 deletions

View file

@ -59,7 +59,7 @@ button.selected {
font-weight: bolder; font-weight: bolder;
} }
.working { cursor: progress; } .working { cursor: progress !important; }
.working-visual::after { .working-visual::after {
content: ""; content: "";
@ -71,5 +71,6 @@ button.selected {
background: url(images/spinning-circles.svg) center center / 25% no-repeat; background: url(images/spinning-circles.svg) center center / 25% no-repeat;
cursor: progress !important;
pointer-events: none; pointer-events: none;
} }

View file

@ -54,10 +54,13 @@ class UI {
type: "select", type: "select",
name: "Reading Type", name: "Reading Type",
items: this.reading_types.map((type) => type.friendly_text), items: this.reading_types.map((type) => type.friendly_text),
callback: ((event) => { callback: (async (event) => {
let new_type = this.reading_types.find((type) => type.friendly_text == event.target.value).short_descr; let new_type = this.reading_types.find((type) => type.friendly_text == event.target.value).short_descr;
this.map_manager.overlay.update_reading_type(new_type);
document.querySelector("main").classList.add("working-visual");
await this.map_manager.overlay.update_reading_type(new_type);
document.querySelector("main").classList.remove("working-visual");
}).bind(this) }).bind(this)
}, },
{ {