1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-26 12:57:40 +00:00

Improved error handling for disapearing custom column linked to read status

This commit is contained in:
Ozzieisaacs
2021-05-01 18:42:57 +02:00
parent c0b561cb5a
commit b97373bf37
3 changed files with 32 additions and 10 deletions

View File

@@ -22,7 +22,21 @@ $(function() {
});
$("#have_read_cb").on("change", function() {
$(this).closest("form").submit();
$.post({
url: this.closest("form").action,
error: function(response) {
var data = [{type:"danger", message:response.responseText}]
$("#flash_success").remove();
$("#flash_danger").remove();
if (!jQuery.isEmptyObject(data)) {
data.forEach(function (item) {
$(".navbar").after('<div class="row-fluid text-center" style="margin-top: -20px;">' +
'<div id="flash_' + item.type + '" class="alert alert-' + item.type + '">' + item.message + '</div>' +
'</div>');
});
}
}
});
});
$(function() {