implement first draft of switching handoperatable boats

This commit is contained in:
2024-04-24 09:37:45 +02:00
parent 3f80cb498c
commit a0dbd0f490
8 changed files with 44 additions and 34 deletions

View File

@ -118,6 +118,8 @@ interface ChoiceBoatEvent extends Event {
default_destination: string;
boat_in_ottensheim: boolean;
boat_reserved_today: boolean;
default_handoperated: boolean;
convert_handoperated_possible: boolean;
};
};
}
@ -147,6 +149,19 @@ function selectBoatChange() {
const amount_seats = event.detail.customProperties.amount_seats;
setMaxAmountRowers("newrower", amount_seats);
let only_steering = <HTMLSelectElement>document.querySelector('#shipmaster_only_steering');
if (event.detail.customProperties.default_handoperated) {
only_steering.setAttribute('checked', 'true');
}else {
only_steering.removeAttribute('checked');
}
if (event.detail.customProperties.convert_handoperated_possible) {
only_steering.removeAttribute('disabled');
}else {
only_steering.setAttribute('disabled', 'disabled');
}
const destination = <HTMLSelectElement>(
document.querySelector("#destination")
);
@ -159,9 +174,7 @@ function selectBoatChange() {
if(event.detail.value === '36') {
/** custom code for Etsch */
choiceObjects["newrower"].setChoiceByValue(
"81",
);
choiceObjects["newrower"].setChoiceByValue("81");
}
}
@ -250,22 +263,6 @@ function setMaxAmountRowers(name: string, rowers: number) {
}
}
//let only_steering = <HTMLSelectElement>document.querySelector('#shipmaster_only_steering');
//if(only_steering) {
// if(isShipmasterSteering == 'true') {
// only_steering.removeAttribute('disabled');
// only_steering.setAttribute('checked', 'true');
// only_steering.parentElement?.parentElement?.parentElement?.classList.remove('hidden');
// only_steering.parentElement?.parentElement?.parentElement?.classList.remove('md:block');
// only_steering.parentElement?.parentElement?.parentElement?.classList.remove('opacity-50');
// } else {
// only_steering.setAttribute('disabled', 'disabled');
// only_steering.removeAttribute('checked');
// only_steering.parentElement?.parentElement?.parentElement?.classList.add('hidden');
// only_steering.parentElement?.parentElement?.parentElement?.classList.add('md:block');
// only_steering.parentElement?.parentElement?.parentElement?.classList.add('opacity-50');
// }
//}
let shipmaster = <HTMLElement>(
document.querySelector("#shipmaster-" + name + "js")
);