From 409a367ab7ac7bd422ae0f2f9a7c96a91b5dd399 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Mon, 4 May 2015 16:20:13 +0200 Subject: [PATCH] Replace all occurrences of totalVotes --- .../javascripts/components/poll-results-standard.js.es6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 b/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 index d9268f2fe45..64abdf6680b 100644 --- a/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 +++ b/plugins/poll/assets/javascripts/components/poll-results-standard.js.es6 @@ -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); }