[BUGFIX] duplicate ids checkboxes in sidebar form
This commit is contained in:
		| @@ -189,6 +189,17 @@ function initTripSidebar(triggerElement: HTMLElement) { | ||||
|     let body = <HTMLElement>document.querySelector(triggerElement.dataset.body); | ||||
|     let bodyElement = <HTMLElement>body.cloneNode(true); | ||||
|     let bodyContainerElement = <HTMLElement>sidebarElement.querySelector('.body-js'); | ||||
|      | ||||
|     /* Quickfix duplicate ids checkboxes */ | ||||
|     const checkboxes = <NodeListOf<HTMLElement>>bodyElement.querySelectorAll('input[type="checkbox"]'); | ||||
|  | ||||
|     Array.prototype.forEach.call(checkboxes, (checkbox: HTMLElement) => { | ||||
|       if(checkbox) { | ||||
|         checkbox.parentElement?.setAttribute('for', checkbox.id + 'js'); | ||||
|         checkbox.id += 'js'; | ||||
|       } | ||||
|     }); | ||||
|  | ||||
|     if(bodyContainerElement) { | ||||
|       bodyContainerElement.innerHTML = ''; | ||||
|       bodyContainerElement.append(bodyElement); | ||||
|   | ||||
| @@ -131,7 +131,7 @@ | ||||
|                 <input type="hidden" name="id" value="{{ planned_event.id }}" /> | ||||
|                 {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=planned_event.max_people, min='0') }} | ||||
|                 {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=planned_event.planned_amount_cox, required=true, min='0') }} | ||||
|     		{{ macros::checkbox(label='Immer anzeigen', name='always_show', checked=planned_event.always_show) }} | ||||
|     		        {{ macros::checkbox(label='Immer anzeigen', name='always_show', id=planned_event.id,checked=planned_event.always_show) }} | ||||
|                 {{ macros::input(label='Anmerkungen', name='notes', type='input', value=planned_event.notes) }} | ||||
|  | ||||
|                 <input value="Bearbeiten" class="btn btn-primary" type="submit" /> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Marie Birner
					Marie Birner