[BUGFIX] js errors

This commit is contained in:
Marie Birner 2023-09-27 13:52:15 +02:00 committed by philipp
parent c2e0c874ad
commit 885fb0f2c1

View File

@ -20,6 +20,8 @@ document.addEventListener('DOMContentLoaded', function() {
function selectBoatChange() { function selectBoatChange() {
const boatSelect = <HTMLSelectElement>document.querySelector('#boat_id'); const boatSelect = <HTMLSelectElement>document.querySelector('#boat_id');
if(boatSelect) {
const boatChoice = new Choices(boatSelect, { const boatChoice = new Choices(boatSelect, {
loadingText: 'Wird geladen...', loadingText: 'Wird geladen...',
noResultsText: 'Keine Ergebnisse gefunden', noResultsText: 'Keine Ergebnisse gefunden',
@ -50,8 +52,10 @@ function selectBoatChange() {
} as any); } as any);
choiceObjects[boatSelect.id] = boatChoice; choiceObjects[boatSelect.id] = boatChoice;
}
const shipmasterSelect = <HTMLSelectElement>document.querySelector('#shipmaster'); const shipmasterSelect = <HTMLSelectElement>document.querySelector('#shipmaster');
if(shipmasterSelect) {
const shipmasterChoice = new Choices(shipmasterSelect, { const shipmasterChoice = new Choices(shipmasterSelect, {
loadingText: 'Wird geladen...', loadingText: 'Wird geladen...',
noResultsText: 'Keine Ergebnisse gefunden', noResultsText: 'Keine Ergebnisse gefunden',
@ -60,6 +64,7 @@ function selectBoatChange() {
}); });
choiceObjects[shipmasterSelect.id] = shipmasterChoice; choiceObjects[shipmasterSelect.id] = shipmasterChoice;
}
} }
function setMaxAmountRowers(rowers: number){ function setMaxAmountRowers(rowers: number){