[TASK] select boat on click

This commit is contained in:
Marie Birner
2023-09-23 23:23:42 +02:00
committed by philipp
parent 97ef19513e
commit 2e5b913c8c
2 changed files with 5 additions and 1 deletions

View File

@ -42,6 +42,10 @@ function initBoatActions() {
const rowers = Number(select.dataset.seats) - 1;
choiceObjects['newrower'].config.maxItemCount = rowers;
choiceObjects['newrower'].removeActiveItems(rowers);
let boatSelect = <HTMLSelectElement>document.querySelector('#boat_id');
if(boatSelect && select.dataset.id) {
boatSelect.value = select.dataset.id;
}
(rowers === 0 ? choiceObjects['newrower'].disable() : choiceObjects['newrower'].enable());
}
});