From d297893086b6b5326fea617aa4916bf514868c9a Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 30 Oct 2023 15:37:01 +0100 Subject: [PATCH] fix ci --- frontend/main.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index abd5e5b..81a845d 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -29,6 +29,16 @@ function setCurrentdate(input: HTMLInputElement) { } } +interface ChoiceBoatEvent extends Event{ + detail: { + value: string; + label: string, + customProperties: { + amount_seats: number, + } + }; +} + function selectBoatChange() { const boatSelect = document.querySelector('#boat_id'); @@ -41,7 +51,8 @@ function selectBoatChange() { } as any); boatSelect.addEventListener('addItem', function(e) { - const amount_seats = e.detail.customProperties.amount_seats; + const event = e as ChoiceBoatEvent; + const amount_seats = event.detail.customProperties.amount_seats; setMaxAmountRowers("newrower", amount_seats); const inputElement = document.getElementById("departure") as HTMLInputElement; @@ -75,7 +86,7 @@ function reloadPage() { function setMaxAmountRowers(name: string, rowers: number) { console.log("called fct: name="+name+"; rowers="+rowers); if(choiceObjects[name]) { - choiceObjects[name].removeActiveItems(); + choiceObjects[name].removeActiveItems(-1); //let curSelection = choiceObjects[name].getValue(true); //let amount_to_delete = (curSelection).length - rowers; @@ -157,7 +168,6 @@ interface ChoiceEvent extends Event{ is_cox: boolean, steers: boolean, cox_on_boat: boolean, - amount_seats: number, } }; }