From 74dabae39045acb71e2c6d4561cc13d0318bce9f Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 30 Oct 2023 19:08:19 +0100 Subject: [PATCH] clean up + make maxitemcount in sidebar work --- frontend/main.ts | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index 81a845d..4cd5700 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -84,7 +84,6 @@ function reloadPage() { } function setMaxAmountRowers(name: string, rowers: number) { - console.log("called fct: name="+name+"; rowers="+rowers); if(choiceObjects[name]) { choiceObjects[name].removeActiveItems(-1); //let curSelection = choiceObjects[name].getValue(true); @@ -131,7 +130,6 @@ function setMaxAmountRowers(name: string, rowers: number) { // } //} } - console.log(choiceObjects["newrower"].config.maxItemCount); } function initBoatActions() { @@ -180,32 +178,10 @@ function initNewChoice(select: HTMLInputElement) { noChoicesText: 'Keine Ergebnisse gefunden', itemSelectText: 'Zum Auswählen klicken', placeholderValue: 'Ruderer auswählen', - maxItemCount: -1, //TODO + maxItemCount: select.dataset.seats, maxItemText: (maxItemCount) => { return `Nur ${maxItemCount} Ruderer können hinzugefügt werden`; }, - callbackOnCreateTemplates: function () { - return { - option: ({ label, value, customProperties, active, disabled, }: any) => { - const opt: HTMLOptionElement = Choices.defaults.templates.option.call( - this, - { label, value, customProperties, active, disabled } - ); - - // We get the original