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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user