forked from CGM_Public/pretix_original
load errors.js as standard and make it coop with async_task_replace_page
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user