diff options
author | PayBas <contact@paybas.com> | 2014-04-06 16:43:25 +0200 |
---|---|---|
committer | PayBas <contact@paybas.com> | 2014-04-06 16:43:25 +0200 |
commit | 3384e87b6f1f6ba3532257585392a8b7e1034a18 (patch) | |
tree | e66adf357984328cef8bb38fd023cbfbd260076f /phpBB/styles/prosilver/template/ajax.js | |
parent | 0e88f0db4ad728ed071f42301ee7196c8bf1c2ab (diff) | |
download | forums-3384e87b6f1f6ba3532257585392a8b7e1034a18.tar forums-3384e87b6f1f6ba3532257585392a8b7e1034a18.tar.gz forums-3384e87b6f1f6ba3532257585392a8b7e1034a18.tar.bz2 forums-3384e87b6f1f6ba3532257585392a8b7e1034a18.tar.xz forums-3384e87b6f1f6ba3532257585392a8b7e1034a18.zip |
[ticket/12363] Mark winning (most votes) results bar
PHPBB3-12363
Diffstat (limited to 'phpBB/styles/prosilver/template/ajax.js')
-rw-r--r-- | phpBB/styles/prosilver/template/ajax.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js index d2a070d11b..2a96c6090c 100644 --- a/phpBB/styles/prosilver/template/ajax.js +++ b/phpBB/styles/prosilver/template/ajax.js @@ -244,10 +244,12 @@ phpbb.addAjaxCallback('vote_poll', function(res) { var option = $(this); var option_id = option.attr('data-poll-option-id'); var voted = (typeof res.user_votes[option_id] !== 'undefined') ? true : false; + var winner = (res.vote_counts[option_id] == most_votes) ? true : false; var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[option_id] / res.total_votes) * 100); var percent_rel = (most_votes == 0) ? 0 : Math.round((res.vote_counts[option_id] / most_votes) * 100); option.toggleClass('voted', voted); + option.toggleClass('winner', winner); // Update the bars var bar = option.find('.resultbar div'); |