From 66d70e9ecd6e3f1ba98f742287fe963679e46dd5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 25 May 2023 09:38:53 +0200 Subject: [PATCH] Bug 33568: Fix DT dom and remove DT info if not needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Was there a real need to deal with a specific dom? The "no filter" view was not really light, only the column filters were shown/hidden. This patch is suggesting to remove all the DT info in case the table is displaying all the items of the bibliographic record: Pagination, filtering, buttons, etc. This patch is for discussion. Signed-off-by: Owen Leonard Signed-off-by: Laurence Rault Signed-off-by: Emily Lamancusa Signed-off-by: Tomás Cohen Arazi --- .../html_helpers/tables/items/catalogue_detail.inc | 11 +++++++++-- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index e640d8ef5e9..fe410833bb1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -136,7 +136,7 @@ tab.find(".show_filters").hide(); tab.find(".hide_filters").show(); $("#"+tab_id+"_table thead tr:eq(1)").remove(); - build_items_table(tab_id, true, { dom: dataTablesDefaults.dom, destroy: true } ); + build_items_table(tab_id, true, { destroy: true } ); }); $(".hide_filters").on("click",function(e){ @@ -146,7 +146,7 @@ tab.find(".hide_filters").hide(); tab.find(".show_filters").show(); $("#"+tab_id+"_table thead tr:eq(1)").remove(); - build_items_table(tab_id, false, { dom: '<"dt-info"i><"top pager"lpfB><"#filter_c">tr<"bottom pager"ip>', destroy: true } ); + build_items_table(tab_id, false, { destroy: true } ); }); }); [% END %] @@ -723,6 +723,13 @@ }); } ); + + if (!add_filters && settings._iRecordsDisplay == settings._iRecordsTotal && settings._iDisplayLength >= settings._iRecordsDisplay){ + let container = $(this).parent(); + container.find(".dt-info").remove(); + container.find(".top.pager").remove(); + container.find(".bottom.pager").remove(); + } }, [% END %] ...dt_options, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 8b9b20923f4..ff690d3cb16 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1710,7 +1710,7 @@ let items_tab_ids = [ 'holdings', 'otherholdings' ]; items_tab_ids.forEach( function( tab_id, index ) { - build_items_table(tab_id, false, { dom: 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>' }); + build_items_table(tab_id, false); [% IF bundlesEnabled %] // Add event listener for opening and closing bundle details -- 2.34.1