Display errors caused in AJAX requests

This commit is contained in:
Raphael Michel
2016-06-27 19:49:45 +02:00
parent d3ffc2b0dc
commit 5cbb967744
9 changed files with 41 additions and 12 deletions

View File

@@ -19,6 +19,8 @@ $(function () {
$("#voucher-box").slideDown();
$("#voucher-toggle").slideUp();
});
$("#ajaxerr").on("click", ".ajaxerr-close", ajaxErrDialog.hide);
});
var waitingDialog = {
@@ -32,3 +34,17 @@ var waitingDialog = {
$("body").removeClass("loading");
}
};
var ajaxErrDialog = {
show: function (c) {
"use strict";
$("#ajaxerr").html(c);
$("#ajaxerr .links").html("<a class='btn btn-default ajaxerr-close'>"
+ gettext("Close message") + "</a>");
$("body").addClass("ajaxerr");
},
hide: function () {
"use strict";
$("body").removeClass("ajaxerr");
}
};