Tweak progress template to better handle reset to 0%
for those tasks which invoke the progress meter multiple times
This commit is contained in:
parent
24831af231
commit
35126e8e5b
|
@ -78,16 +78,19 @@
|
|||
$('#total').html('done!');
|
||||
$('#complete').css('width', '100%');
|
||||
$('#remaining').hide();
|
||||
$('#percentage').html('100%');
|
||||
$('#percentage').html('100 %');
|
||||
location.href = data.success_url;
|
||||
} else {
|
||||
var width = parseInt(data.value) / parseInt(data.maximum);
|
||||
width = Math.round(100 * width);
|
||||
if (width > 0) {
|
||||
if (width) {
|
||||
$('#complete').css('width', width+'%');
|
||||
$('#remaining').css('width', 'auto');
|
||||
$('#percentage').html(width+' %');
|
||||
} else {
|
||||
$('#complete').css('width', '0.01%');
|
||||
$('#percentage').html('0 %');
|
||||
}
|
||||
$('#percentage').html(width+'%');
|
||||
$('#remaining').css('width', 'auto');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue