mirror of
https://github.com/pretix/pretix.git
synced 2026-08-06 10:07:50 +00:00
load errors.js as standard and make it coop with async_task_replace_page
This commit is contained in:
@@ -20,6 +20,5 @@
|
||||
<div class="container">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
<script src="{% static "pretixbase/js/errors.js" %}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -22,4 +22,5 @@
|
||||
<script type="text/javascript" src="{% static "pretixpresale/js/ui/iframe.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "pretixbase/js/addressform.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "pretixbase/js/deanonymize_email.js" %}"></script>
|
||||
<script type="text/javascript" src="{% static "pretixbase/js/errors.js" %}"></script>
|
||||
{% endcompress %}
|
||||
|
||||
@@ -107,6 +107,7 @@ function async_task_replace_page(target, new_html) {
|
||||
setup_collapsible_details($(target));
|
||||
window.setTimeout(function () { $(window).scrollTop(0) }, 200)
|
||||
$(document).trigger("pretix:bind-forms");
|
||||
$(document).trigger("pretix:async_task_replace_page");
|
||||
}
|
||||
|
||||
function async_task_check_error(jqXHR, textStatus, errorThrown) {
|
||||
|
||||
@@ -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