Improve load behavior of ajaxpending.js

This commit is contained in:
Raphael Michel
2020-10-31 16:33:45 +01:00
parent ba4eff5545
commit da149682aa
2 changed files with 9 additions and 6 deletions

View File

@@ -13,7 +13,7 @@
<script type="text/javascript" src="{% static "pretixbase/js/ajaxpending.js" %}"></script>
{% endcompress %}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="1">
<meta http-equiv="refresh" content="10">
</head>
<body>
<div class="container">

View File

@@ -1,7 +1,10 @@
window.setInterval(function () {
$.get(location.href + '?ajax=1', function (data, status) {
if (data === "1") {
location.reload();
var check = function () {
$.getJSON(location.href + '&ajax=1', function (data, status) {
if (data.redirect) {
location.href = data.redirect;
} else {
window.setTimeout(check, 500);
}
});
}, 500);
}
window.setTimeout(check, 500);