private readonly options: UiPollEditorOptions;
private readonly optionList: HTMLOListElement;
private readonly questionField: HTMLInputElement;
- private readonly resultsRequireVoteField: HTMLInputElement;
+ private readonly resultsRequireVoteNoField: HTMLInputElement | null;
+ private readonly resultsRequireVoteYesField: 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.resultsRequireVoteField = document.getElementById(
+ this.resultsRequireVoteYesField = 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.resultsRequireVoteField.checked = false;
+ this.resultsRequireVoteYesField.checked = false;
+ if (this.resultsRequireVoteNoField) this.resultsRequireVoteNoField.checked = true;
this.sortByVotesField.checked = false;
EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", {
data.pollIsChangeable = true;
}
- if (this.resultsRequireVoteField.checked) {
+ if (this.resultsRequireVoteYesField.checked) {
data.pollResultsRequireVote = true;
}
[this.maxVotesField.id]: this.maxVotesField.value,
[this.isChangeableYesField.id]: !!this.isChangeableYesField.checked,
[this.isPublicField.id]: !!this.isPublicField.checked,
- [this.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.checked,
+ [this.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked,
[this.sortByVotesField.id]: !!this.sortByVotesField.checked,
};
}
options;
optionList;
questionField;
- resultsRequireVoteField;
+ resultsRequireVoteNoField;
+ resultsRequireVoteYesField;
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.resultsRequireVoteField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote");
+ this.resultsRequireVoteYesField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote");
+ this.resultsRequireVoteNoField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote_no");
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.resultsRequireVoteField.checked = false;
+ this.resultsRequireVoteYesField.checked = false;
+ if (this.resultsRequireVoteNoField)
+ this.resultsRequireVoteNoField.checked = true;
this.sortByVotesField.checked = false;
EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", {
pollEditor: this,
if (this.isChangeableYesField.checked) {
data.pollIsChangeable = true;
}
- if (this.resultsRequireVoteField.checked) {
+ if (this.resultsRequireVoteYesField.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.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.checked,
+ [this.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked,
[this.sortByVotesField.id]: !!this.sortByVotesField.checked,
};
}