From 9df606baf5ed20289e984915fe25c0e94c965550 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 28 Jan 2025 12:28:27 +0100 Subject: [PATCH] Bug 38440: Remove useless handling of .dt_button_clear_filter There is only one occurrence in the whole codebase, we should not handle the behaviour of this "clear filter" button outside of datatables.js Test plan: Go to Additional content Use the form on the left side of the page, confirm that the table is filtered when a new keyword is entered Notice that the global search of the table is filled in with the keyword "Clear filters" should reset both inputs, and redraw the table --- .../prog/en/modules/tools/additional-contents.tt | 16 ---------------- 1 file changed, 16 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 ddac9fdd71c..976bc67f73f 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 @@ -576,15 +576,6 @@ } else { table.search( term ).draw(); } - clearFilter( term ); - } - - function clearFilter( term ){ - if( term == "" ){ - $(".dt_button_clear_filter").addClass("disabled"); - } else { - $(".dt_button_clear_filter").removeClass("disabled"); - } } /* Custom table search configuration: If a table row @@ -655,13 +646,6 @@ var opt = $(this).find("option:selected").text(); filterDataTable( table_dt, 2, opt ); }); - - $(".dt_button_clear_filter").on("click", function(){ - table_dt.search('').columns().search('').draw(); - $("#news-filter select").each(function(){ - $(this).val(""); - }); - }); }); [% ELSE %] -- 2.34.1