Bug 33568: Restore column filters when StaffDetailItemSelection is off

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2023-10-30 17:51:33 +01:00 committed by Katrin Fischer
parent 67c472eeac
commit ce216aaa82
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -46,12 +46,11 @@
[% END %]
[% BLOCK items_table %]
<div class="[% tab | html %]_table_table_controls">
<span class="show_hide_filters">
<a href="#" class="show_filters" data-tab="[% tab | html %]"><i class="fa fa-filter"></i> Show filters</a>
<a href="#" class="hide_filters" data-tab="[% tab | html %]" style="display: none;"><i class="fa fa-filter"></i> Hide filters</a>
</span>
[% IF (StaffDetailItemSelection) %]
<span class="show_hide_filters">
<a href="#" class="show_filters" data-tab="[% tab | html %]"><i class="fa fa-filter"></i> Show filters</a>
<a href="#" class="hide_filters" data-tab="[% tab | html %]" style="display: none;"><i class="fa fa-filter"></i> Hide filters</a>
</span>
| <a href="#" class="SelectAll" data-tab="[% tab | html %]"><i class="fa fa-check"></i> Select all</a>
| <a href="#" class="ClearAll" data-tab="[% tab | html %]"><i class="fa fa-times"></i> Clear all</a>
<span class="itemselection_actions">
@ -142,31 +141,38 @@
itemSelectionBuildActionLinks(tab_id);
});
$(".show_filters").on("click",function(e){
e.preventDefault();
let tab_id = $(this).data("tab");
let tab = $("#"+tab_id);
tab.find(".show_filters").hide();
tab.find(".hide_filters").show();
$("#"+tab_id+"_table thead tr:eq(1)").remove();
build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback );
itemSelectionBuildActionLinks(tab_id);
});
$(".hide_filters").on("click",function(e){
e.preventDefault();
let tab_id = $(this).data("tab");
let tab = $("#"+tab_id);
tab.find(".hide_filters").hide();
tab.find(".show_filters").show();
$("#"+tab_id+"_table thead tr:eq(1)").remove();
build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback );
itemSelectionBuildActionLinks(tab_id);
});
});
[% END %]
$(document).ready(function() {
$(".show_filters").on("click",function(e){
e.preventDefault();
let tab_id = $(this).data("tab");
let tab = $("#"+tab_id);
tab.find(".show_filters").hide();
tab.find(".hide_filters").show();
$("#"+tab_id+"_table thead tr:eq(1)").remove();
build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback );
[% IF StaffDetailItemSelection %]
itemSelectionBuildActionLinks(tab_id);
[% END %]
});
$(".hide_filters").on("click",function(e){
e.preventDefault();
let tab_id = $(this).data("tab");
let tab = $("#"+tab_id);
tab.find(".hide_filters").hide();
tab.find(".show_filters").show();
$("#"+tab_id+"_table thead tr:eq(1)").remove();
build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback );
[% IF StaffDetailItemSelection %]
itemSelectionBuildActionLinks(tab_id);
[% END %]
});
});
const all_libraries = [% To.json(Branches.all) | $raw %];
const libraries_filters = all_libraries.map(e => {
e["_id"] = e["branchcode"];