load errors.js as standard and make it coop with async_task_replace_page

This commit is contained in:
Lukas Bockstaller
2026-06-15 11:41:28 +02:00
parent 5a6870fce1
commit 6d405a608f
4 changed files with 18 additions and 5 deletions
+16 -4
View File
@@ -1,5 +1,17 @@
document.getElementById('goback').onclick =
function() {window.history.back()};
const registerErrorLinkHandlers = (reloadAll = false) => {
const backwards = document.getElementById('goback');
if (backwards) {
backwards.onclick = reloadAll
? () => window.location.reload(true)
: () => window.history.back();
}
document.getElementById('reload').onclick =
function() {window.location.reload(true)};
const reload = document.getElementById('reload');
if (reload) {
reload.onclick = () => window.location.reload(true);
}
};
registerErrorLinkHandlers();
$(document).on("pretix:async_task_replace_page", () => registerErrorLinkHandlers(true));