You can now create cards from runners by searching via #runnerid

ref #162
This commit is contained in:
2023-03-15 13:12:42 +01:00
parent 92b89cc4d8
commit e8a0ad6647

View File

@@ -12,17 +12,22 @@
export let modal_open; export let modal_open;
export let current_cards; export let current_cards;
const getRunnerLabel = (option) => const getRunnerLabel = (option) => {
{
if (option.middlename) { if (option.middlename) {
return option.firstname + " " + option.middlename + " " + option.lastname; return option.firstname + " " + option.middlename + " " + option.lastname;
} }
return option.firstname + " " + option.lastname; return option.firstname + " " + 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();
} }