forked from CGM_Public/pretix_original
* load errors.js as standard and make it coop with async_task_replace_page * scope down event * Update src/pretix/static/pretixbase/js/asynctask.js Co-authored-by: pajowu <engelhardt@pretix.eu> * drop the jquery dependency for error.js Co-authored-by: pajowu <pajowu@pajowu.de> * include errors.js in error.html * include errors.js in control base.html * Update src/pretix/static/pretixbase/js/asynctask.js Co-authored-by: Richard Schreiber <schreiber@pretix.eu> * put errors.js in an IIFE call --------- Co-authored-by: pajowu <engelhardt@pretix.eu> Co-authored-by: pajowu <pajowu@pajowu.de> Co-authored-by: Richard Schreiber <schreiber@pretix.eu>
12 lines
435 B
JavaScript
12 lines
435 B
JavaScript
['DOMContentLoaded', 'pretix:async-task-error'].forEach(function (ev) {
|
|
document.addEventListener(ev, function () {
|
|
document.querySelectorAll('#goback, #reload').forEach(function (element) {
|
|
const regularLoad = ev === 'DOMContentLoaded' && element.id === 'goback';
|
|
element.addEventListener('click', regularLoad
|
|
? () => window.history.back()
|
|
: () => window.location.reload()
|
|
);
|
|
});
|
|
});
|
|
});
|