Funkční kotva na korekturu
This commit is contained in:
parent
0c43c56698
commit
bfd8619505
1 changed files with 6 additions and 2 deletions
|
@ -22,7 +22,6 @@
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (!response.ok && catchError) {alert('Něco se nepovedlo:' + response.statusText);}
|
if (!response.ok && catchError) {alert('Něco se nepovedlo:' + response.statusText);}
|
||||||
else response.json().then(data => {
|
else response.json().then(data => {
|
||||||
if (pri_uspechu) pri_uspechu();
|
|
||||||
for (const oprava_data of data["context"]) {
|
for (const oprava_data of data["context"]) {
|
||||||
const oprava = Oprava.update_or_create(oprava_data);
|
const oprava = Oprava.update_or_create(oprava_data);
|
||||||
for (const komentar_data of oprava_data["komentare"]) {
|
for (const komentar_data of oprava_data["komentare"]) {
|
||||||
|
@ -33,12 +32,17 @@
|
||||||
updatuj_pocty_stavu();
|
updatuj_pocty_stavu();
|
||||||
updatuj_pocty_zasluh();
|
updatuj_pocty_zasluh();
|
||||||
place_comments();
|
place_comments();
|
||||||
|
if (pri_uspechu) pri_uspechu();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {if (catchError) alert('Něco se nepovedlo:' + error);});
|
.catch(error => {if (catchError) alert('Něco se nepovedlo:' + error);});
|
||||||
}
|
}
|
||||||
|
|
||||||
update_all();
|
window.addEventListener("load", _ => {
|
||||||
|
update_all({}, true, _ => {
|
||||||
|
if (location.hash !== "") location.hash = location.hash; // Po rozházení korektur sescrollujeme na kotvu v URL
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// FIXME není mi jasné, zda v {} nemá být `cache: "no-store"`, aby prohlížeč necachoval GET.
|
// FIXME není mi jasné, zda v {} nemá být `cache: "no-store"`, aby prohlížeč necachoval GET.
|
||||||
document.getElementById("korektury-aktualizace").addEventListener("click", _ => update_all({}, false));
|
document.getElementById("korektury-aktualizace").addEventListener("click", _ => update_all({}, false));
|
||||||
|
|
Loading…
Reference in a new issue