From fe7e171ae6f9f102e4d13310b6d7e1a9133dbe28 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Jan 2025 12:24:41 +0100 Subject: [PATCH] Bug 38255: Fix additional-contents --- .../prog/en/modules/tools/additional-contents.tt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt index 2faee1b7d64..ddac9fdd71c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -611,6 +611,7 @@ ], pagingType: "full_numbers", }); + let table_dt = table.DataTable(); $("#del_form").on("click", ".delete_news", function(e){ e.preventDefault(); @@ -631,32 +632,32 @@ $("#show_expired").on("change", function(){ /* redraw the DataTable according to the custom search function */ - table.draw(); + table_dt.draw(); }); - table.on( 'search.dt', function () { - var term = table.search(); + table_dt.on( 'search.dt', function () { + var term = table_dt.search(); $("#news_keyword").val( term ); }); $("#news_keyword").on("keyup", function(){ var term = $(this).val(); - filterDataTable( table, null, term ); + filterDataTable( table_dt, null, term ); }); $("#news_display_location").on("change", function(){ var term = $(this).val(); - filterDataTable( table, 1, term ); + filterDataTable( table_dt, 1, term ); }); $("#news_library").on("change", function(){ // Table must be filtered by the