Commit 244da7de852b829976b54bf252ba97612dc4786f

Authored by Fabio Teixeira
1 parent 00821581

correcting_progressbar_bug: Only calculate the percentage on the pages that cont…

…ain the percentage div

Signed-off-by: Fabio Teixeira  <fabio1079@gmail.com>
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing 1 changed file with 9 additions and 6 deletions   Show diff stats
public/mpog-incomplete-registration.js
... ... @@ -10,14 +10,17 @@ function hide_incomplete_percentage(evt) {
10 10 function show_complete_progressbar() {
11 11 var percentage = jQuery("#complete_registration_message span").html();
12 12 var canvas_tag = document.getElementById("complete_registration_percentage");
13   - var context = canvas_tag.getContext("2d");
14 13  
15   - percentage = canvas_tag.width*(percentage/100.0);
  14 + if( canvas_tag != null ) {
  15 + var context = canvas_tag.getContext("2d");
16 16  
17   - context.beginPath();
18   - context.rect(0, 0, percentage, canvas_tag.height);
19   - context.fillStyle = '#00FF00';
20   - context.fill();
  17 + percentage = canvas_tag.width*(percentage/100.0);
  18 +
  19 + context.beginPath();
  20 + context.rect(0, 0, percentage, canvas_tag.height);
  21 + context.fillStyle = '#00FF00';
  22 + context.fill();
  23 + }
21 24 }
22 25  
23 26 jQuery(document).ready(function(){
... ...