Moved filter function to typed version
All checks were successful
continuous-integration/drone/push Build is passing

closes #171
This commit is contained in:
Nicolai Ort 2023-04-12 14:16:36 +02:00
parent ee91748b3c
commit 1af047f66e
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F

View File

@ -13,9 +13,16 @@
export let original_data = {}; export let original_data = {};
const getRunnerLabel = (option) => const getRunnerLabel = (option) =>
option.firstname + " " + (option.middlename || "") + " " + option.lastname; option.firstname + " " + (option.middlename || "") + " " + option.lastname;
const filterRunners = (label, filterText, option) => const filterRunners = (label, filterText, option) => {
if (filterText.startsWith("#")) {
return option.value.id == parseInt(filterText.replace("#",""))
}
return (
label.toLowerCase().includes(filterText.toLowerCase()) || label.toLowerCase().includes(filterText.toLowerCase()) ||
option.value.toString().startsWith(filterText.toLowerCase()); option.value.toString().startsWith(filterText.toLowerCase())
);
};
function focus(el) { function focus(el) {
el.focus(); el.focus();
} }