Bug 38724: Do not show the filters when updating col vis (if not needed)

(In reply to Brendan Lawlor from bug 38632 comment #7)
> During testing I noticed small related bug in current main. On the
> bibliographic record details page if you click to configure columns and you
> add or remove a column it automatically shows the column filters too, but it
> does not toggle the filter link to 'Hide filters` so you have to click twice
> to hide them.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 11500e7352)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2024-12-17 10:12:21 +01:00 committed by Paul Derscheid
parent ac964e2658
commit 7d5e03fec7
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 6 additions and 1 deletions

View File

@ -178,6 +178,7 @@
});
let filters_shown = false;
$(document).ready(function() {
$(".show_filters").on("click",function(e){
e.preventDefault();
@ -185,6 +186,7 @@
let tab = $("#" + tab_id + "_panel" );
tab.find(".show_filters").hide();
tab.find(".hide_filters").show();
filters_show = true;
$("#"+tab_id+"_table thead tr:eq(1)").remove();
build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback );
itemSelectionBuildActionLinks(tab_id);
@ -196,6 +198,7 @@
let tab = $("#" + tab_id + "_panel" );
tab.find(".hide_filters").hide();
tab.find(".show_filters").show();
filters_show = false;
$("#"+tab_id+"_table thead tr:eq(1)").remove();
build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback );
itemSelectionBuildActionLinks(tab_id);
@ -876,7 +879,9 @@
table_dt.on("column-visibility.dt", function(e, settings, column, state, recalc ){
if (recalc === false) return;
_dt_add_filters(this, table_dt, filters_options);
if ( filters_shown ) {
_dt_add_filters(this, table_dt, filters_options);
}
user_colvis[tab_id][column] = state;