Merge pull request #3429 from gschlager/patch-1

Replace all occurrences of totalVotes with voters
This commit is contained in:
Régis Hanol 2015-05-04 16:23:33 +02:00
commit 5c7b984d2f
1 changed files with 2 additions and 2 deletions

View File

@ -3,11 +3,11 @@ export default Em.Component.extend({
classNames: ["results"],
options: function() {
const totalVotes = this.get("poll.voters"),
const voters = this.get("poll.voters"),
backgroundColor = this.get("poll.background");
this.get("poll.options").forEach(option => {
const percentage = totalVotes == 0 ? 0 : Math.floor(100 * option.get("votes") / totalVotes),
const percentage = voters === 0 ? 0 : Math.floor(100 * option.get("votes") / voters),
styles = ["width: " + percentage + "%"];
if (backgroundColor) { styles.push("background: " + backgroundColor); }