ooops, we actually need that :fired:
This commit is contained in:
@@ -6,10 +6,12 @@ export default Em.Component.extend({
|
||||
const voters = this.get("poll.voters");
|
||||
|
||||
this.get("poll.options").forEach(option => {
|
||||
const percentage = voters === 0 ? 0 : Math.floor(100 * option.get("votes") / voters);
|
||||
const percentage = voters === 0 ? 0 : Math.floor(100 * option.get("votes") / voters),
|
||||
style = "width: " + percentage + "%".htmlSafe();
|
||||
|
||||
option.setProperties({
|
||||
percentage,
|
||||
style,
|
||||
title: I18n.t("poll.option_title", { count: option.get("votes") })
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user