Commits

Job Ganzevoort  committed d5af3f7

improvement: let biggest result use full width

  • Participants
  • Parent commits ca382ba

Comments (0)

Files changed (1)

File poll/templates/_polls_script.js

 					total = value;
 				} else {
 					var percentage = (data[index]['count'] * 100) / all_points;
+					var display_percentage = (data[index]['count'] * 100) / biggest;
 					var bar_class = 'dps_poll_normal_bar';
 					
 					if(data[index]['count'] == biggest) {
 					
 					body.append('<dl class="dps_poll_item_dl">');
 					body.append('<dt>' + data[index]['title'] + ': <strong>' + (Math.round(percentage*100)/100) + '%</strong>' + points_txt + '</dt>');
-					body.append('<dd><div class="' + bar_class + '" style="width: ' + percentage + '%;"></div></dd>');
+					body.append('<dd><div class="' + bar_class + '" style="width: ' + display_percentage + '%;"></div></dd>');
 					body.append('</dl>');
 				}
 			});