From 19ec21942724c547c4421f74418051d0cbcec8d0 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 Signed-off-by: Owen Leonard Signed-off-by: Lucas Gass --- .../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 75e1a5215b8..55ff68620e7 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 @@ -580,15 +580,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 @@ -656,13 +647,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