mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Fix ajax error not being shown
This commit is contained in:
@@ -330,9 +330,11 @@ var ajaxErrDialog = {
|
|||||||
$("#ajaxerr .links").html("<a class='btn btn-default ajaxerr-close'>"
|
$("#ajaxerr .links").html("<a class='btn btn-default ajaxerr-close'>"
|
||||||
+ gettext("Close message") + "</a>");
|
+ gettext("Close message") + "</a>");
|
||||||
$("body").addClass("ajaxerr has-modal-dialog");
|
$("body").addClass("ajaxerr has-modal-dialog");
|
||||||
|
$("#ajaxerr").prop("hidden", false);
|
||||||
},
|
},
|
||||||
hide: function () {
|
hide: function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
$("body").removeClass("ajaxerr has-modal-dialog");
|
$("body").removeClass("ajaxerr has-modal-dialog");
|
||||||
|
$("#ajaxerr").prop("hidden", true);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ var i18nToString = function (i18nstring) {
|
|||||||
$(document).ajaxError(function (event, jqXHR, settings, thrownError) {
|
$(document).ajaxError(function (event, jqXHR, settings, thrownError) {
|
||||||
waitingDialog.hide();
|
waitingDialog.hide();
|
||||||
var c = $(jqXHR.responseText).filter('.container');
|
var c = $(jqXHR.responseText).filter('.container');
|
||||||
if (jqXHR.responseText.indexOf("<!-- pretix-login-marker -->") !== -1) {
|
if (jqXHR.responseText && jqXHR.responseText.indexOf("<!-- pretix-login-marker -->") !== -1) {
|
||||||
location.href = '/control/login?next=' + encodeURIComponent(location.pathname + location.search + location.hash)
|
location.href = '/control/login?next=' + encodeURIComponent(location.pathname + location.search + location.hash)
|
||||||
} else if (c.length > 0) {
|
} else if (c.length > 0) {
|
||||||
ajaxErrDialog.show(c.first().html());
|
ajaxErrDialog.show(c.first().html());
|
||||||
|
|||||||
Reference in New Issue
Block a user