private readonly options: UiPollEditorOptions;
private readonly optionList: HTMLOListElement;
private readonly questionField: HTMLInputElement;
- private readonly resultsRequireVoteNoField: HTMLInputElement | null;
- private readonly resultsRequireVoteYesField: HTMLInputElement;
+ private readonly resultsRequireVoteField: HTMLInputElement;
private readonly sortByVotesField: HTMLInputElement;
private readonly wysiwygId: string;
this.maxVotesField = document.getElementById(this.wysiwygId + "Poll_maxVotes") as HTMLInputElement;
this.isChangeableYesField = document.getElementById(this.wysiwygId + "Poll_isChangeable") as HTMLInputElement;
this.isPublicField = document.getElementById(this.wysiwygId + "Poll_isPublic") as HTMLInputElement;
- this.resultsRequireVoteYesField = document.getElementById(
+ this.resultsRequireVoteField = document.getElementById(
this.wysiwygId + "Poll_resultsRequireVote",
) as HTMLInputElement;
- this.resultsRequireVoteNoField = document.getElementById(
- this.wysiwygId + "Poll_resultsRequireVote_no",
- ) as HTMLInputElement;
this.sortByVotesField = document.getElementById(this.wysiwygId + "Poll_sortByVotes") as HTMLInputElement;
this.optionCount = 0;
this.maxVotesField.value = "1";
this.isChangeableYesField.checked = false;
this.isPublicField.checked = false;
- this.resultsRequireVoteYesField.checked = false;
- if (this.resultsRequireVoteNoField) this.resultsRequireVoteNoField.checked = true;
+ this.resultsRequireVoteField.checked = false;
this.sortByVotesField.checked = false;
EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", {
data.pollIsChangeable = true;
}
- if (this.resultsRequireVoteYesField.checked) {
+ if (this.resultsRequireVoteField.checked) {
data.pollResultsRequireVote = true;
}
[this.maxVotesField.id]: this.maxVotesField.value,
[this.isChangeableYesField.id]: !!this.isChangeableYesField.checked,
[this.isPublicField.id]: !!this.isPublicField.checked,
- [this.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked,
+ [this.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.checked,
[this.sortByVotesField.id]: !!this.sortByVotesField.checked,
};
}
options;
optionList;
questionField;
- resultsRequireVoteNoField;
- resultsRequireVoteYesField;
+ resultsRequireVoteField;
sortByVotesField;
wysiwygId;
constructor(containerId, pollOptions, wysiwygId, options) {
this.maxVotesField = document.getElementById(this.wysiwygId + "Poll_maxVotes");
this.isChangeableYesField = document.getElementById(this.wysiwygId + "Poll_isChangeable");
this.isPublicField = document.getElementById(this.wysiwygId + "Poll_isPublic");
- this.resultsRequireVoteYesField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote");
- this.resultsRequireVoteNoField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote_no");
+ this.resultsRequireVoteField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote");
this.sortByVotesField = document.getElementById(this.wysiwygId + "Poll_sortByVotes");
this.optionCount = 0;
this.options = Core.extend({
this.maxVotesField.value = "1";
this.isChangeableYesField.checked = false;
this.isPublicField.checked = false;
- this.resultsRequireVoteYesField.checked = false;
- if (this.resultsRequireVoteNoField)
- this.resultsRequireVoteNoField.checked = true;
+ this.resultsRequireVoteField.checked = false;
this.sortByVotesField.checked = false;
EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", {
pollEditor: this,
if (this.isChangeableYesField.checked) {
data.pollIsChangeable = true;
}
- if (this.resultsRequireVoteYesField.checked) {
+ if (this.resultsRequireVoteField.checked) {
data.pollResultsRequireVote = true;
}
if (this.sortByVotesField.checked) {
[this.maxVotesField.id]: this.maxVotesField.value,
[this.isChangeableYesField.id]: !!this.isChangeableYesField.checked,
[this.isPublicField.id]: !!this.isPublicField.checked,
- [this.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked,
+ [this.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.checked,
[this.sortByVotesField.id]: !!this.sortByVotesField.checked,
};
}