Fixes state of the checkboxes in amendments

This commit is contained in:
GabrielMeyer 2019-05-07 15:58:36 +02:00
parent c560f511b5
commit e6c4e1d27b
2 changed files with 15 additions and 2 deletions

View File

@ -30,12 +30,15 @@
*ngIf="multipleParagraphsAllowed"
class="paragraph-select"
[checked]="isParagraphSelected(paragraph)"
></mat-checkbox>
(click)="checkboxClicked($event)"
>
</mat-checkbox>
<mat-radio-button
*ngIf="!multipleParagraphsAllowed"
class="paragraph-select"
[checked]="isParagraphSelected(paragraph)"
></mat-radio-button>
>
</mat-radio-button>
<div class="paragraph-text motion-text" [innerHTML]="paragraph.safeHtml"></div>
</section>
</div>

View File

@ -117,6 +117,16 @@ export class AmendmentCreateWizardComponent extends BaseViewComponent {
return !!this.contentForm.value.selectedParagraphs.find(para => para.paragraphNo === paragraph.paragraphNo);
}
/**
* Function to prevent executing the click event of a checkbox.
* This prevents that the state of the checkbox is not changed by clicking it.
*
* @param event The `MouseEvent`
*/
public checkboxClicked(event: MouseEvent): void {
event.preventDefault();
}
/**
* Called by the template when a paragraph is clicked in single paragraph mode.
* Behaves like a radio-button