1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 22:40:39 +02:00

[ticket/12982] Refactoring: Cleaned up phpbb.search

PHPBB3-12982
This commit is contained in:
Callum Macrae
2014-08-13 23:18:50 +01:00
parent d79fec1c3f
commit 9578fdf7d7
3 changed files with 77 additions and 62 deletions

View File

@@ -235,7 +235,7 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
var $this = $(this);
var optionId = $this.attr('data-poll-option-id');
var voted = (typeof res.user_votes[optionId] !== 'undefined');
var mostVoted = (res.vote_counts[optionId] == mostVotes);
var mostVoted = (res.vote_counts[optionId] === mostVotes);
var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[optionId] / res.total_votes) * 100);
var percentRel = (mostVotes === 0) ? 0 : Math.round((res.vote_counts[optionId] / mostVotes) * 100);
@@ -245,7 +245,7 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
// Update the bars
var bar = $this.find('.resultbar div');
var barTimeLapse = (res.can_vote) ? 500 : 1500;
var newBarClass = (percent == 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1);
var newBarClass = (percent === 100) ? 'pollbar5' : 'pollbar' + (Math.floor(percent / 20) + 1);
setTimeout(function () {
bar.animate({width: percentRel + '%'}, 500)