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 <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2025-01-28 12:28:27 +01:00 committed by Katrin Fischer
parent 70e43a0553
commit 8ea3785f0f
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 0 additions and 16 deletions

View File

@ -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("");
});
});
});
</script>
[% ELSE %]