diff --git a/client/src/app/shared/components/check-input/check-input.component.ts b/client/src/app/shared/components/check-input/check-input.component.ts index 7e7d6ca44..d72033256 100644 --- a/client/src/app/shared/components/check-input/check-input.component.ts +++ b/client/src/app/shared/components/check-input/check-input.component.ts @@ -66,7 +66,13 @@ export class CheckInputComponent extends BaseViewComponent implements OnInit, Co * Subscribes to value-changes of the form-control. */ public ngOnInit(): void { - this.subscriptions.push(this.contentForm.valueChanges.subscribe(value => this.sendValue(value))); + this.subscriptions.push( + this.contentForm.valueChanges.subscribe(value => { + if (value) { + this.sendValue(value); + } + }) + ); } /** diff --git a/client/src/app/site/polls/components/poll-form/poll-form.component.html b/client/src/app/site/polls/components/poll-form/poll-form.component.html index 075654461..2ff0ac862 100644 --- a/client/src/app/site/polls/components/poll-form/poll-form.component.html +++ b/client/src/app/site/polls/components/poll-form/poll-form.component.html @@ -8,17 +8,6 @@ - -
- - - {{ value[0] }} - - - {{ value[1] }} - - -
diff --git a/client/src/app/site/polls/components/poll-form/poll-form.component.ts b/client/src/app/site/polls/components/poll-form/poll-form.component.ts index 720ee9701..4d28d9377 100644 --- a/client/src/app/site/polls/components/poll-form/poll-form.component.ts +++ b/client/src/app/site/polls/components/poll-form/poll-form.component.ts @@ -125,6 +125,10 @@ export class PollFormComponent ex this.groupObservable = this.groupRepo.getViewModelListObservableWithoutDefaultGroup(); if (this.data) { + if (this.data.state) { + this.disablePollType(); + } + if (this.data instanceof ViewAssignmentPoll) { if (this.data.assignment && !this.data.votes_amount) { this.data.votes_amount = this.data.assignment.open_posts; @@ -164,6 +168,10 @@ export class PollFormComponent ex ); } + private disablePollType(): void { + this.contentForm.get('type').disable(); + } + /** * updates the available percent bases according to the pollmethod * @param method the currently chosen pollmethod