Add percentages

This commit is contained in:
Jarek Radosz
2020-07-03 04:23:56 +02:00
parent dfaaa859e4
commit 5271b43531
5 changed files with 57 additions and 13 deletions
@@ -58,9 +58,9 @@ export default Controller.extend(ModalFunctionality, {
}));
},
@discourseComputed("model.poll.options.length")
optionColors(optionsCount) {
return getColors(optionsCount);
@discourseComputed("model.poll.options")
totalVotes(options) {
return options.reduce((sum, option) => sum + option.votes, 0);
},
onShow() {