forked from Ruderverein-Donau-Linz/rowt
show ottensheim boats to rennjugend
This commit is contained in:
@ -6,6 +6,7 @@ export interface choiceMap {
|
||||
}
|
||||
|
||||
let choiceObjects: choiceMap = {};
|
||||
let boat_in_ottensheim = true;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
changeTheme();
|
||||
@ -123,6 +124,8 @@ function selectBoatChange() {
|
||||
|
||||
boatSelect.addEventListener('addItem', function(e) {
|
||||
const event = e as ChoiceBoatEvent;
|
||||
boat_in_ottensheim = event.detail.customProperties.boat_in_ottensheim;
|
||||
|
||||
const amount_seats = event.detail.customProperties.amount_seats;
|
||||
setMaxAmountRowers("newrower", amount_seats);
|
||||
|
||||
@ -320,6 +323,16 @@ function initNewChoice(select: HTMLInputElement) {
|
||||
},
|
||||
callbackOnInit: function() {
|
||||
this._currentState.items.forEach(function(obj){
|
||||
if (boat_in_ottensheim) {
|
||||
if (obj.customProperties.is_racing) {
|
||||
const coxSelect = <HTMLSelectElement>document.querySelector('#shipmaster-' + select.id + 'js');
|
||||
var new_option = new Option(obj.label, obj.value);
|
||||
if (obj.customProperties.cox_on_boat){
|
||||
new_option.selected = true;
|
||||
}
|
||||
coxSelect.add(new_option);
|
||||
}
|
||||
}
|
||||
if (obj.customProperties && obj.customProperties.is_cox){
|
||||
const coxSelect = <HTMLSelectElement>document.querySelector('#shipmaster-' + select.id + 'js');
|
||||
var new_option = new Option(obj.label, obj.value);
|
||||
@ -346,6 +359,14 @@ function initNewChoice(select: HTMLInputElement) {
|
||||
const user_id = event.detail.value;
|
||||
const name = event.detail.label;
|
||||
|
||||
if (boat_in_ottensheim) {
|
||||
if (event.detail.customProperties.is_racing) {
|
||||
const coxSelect = <HTMLSelectElement>document.querySelector('#shipmaster-' + select.id + 'js');
|
||||
if (coxSelect){
|
||||
coxSelect.add(new Option(name, user_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (event.detail.customProperties.is_cox) {
|
||||
const coxSelect = <HTMLSelectElement>document.querySelector('#shipmaster-' + select.id + 'js');
|
||||
if (coxSelect){
|
||||
|
Reference in New Issue
Block a user