Tweak progress template to better handle reset to 0%

for those tasks which invoke the progress meter multiple times
This commit is contained in:
Lance Edgar 2017-02-16 19:44:31 -06:00
parent 24831af231
commit 35126e8e5b

View file

@ -83,11 +83,14 @@
} else { } else {
var width = parseInt(data.value) / parseInt(data.maximum); var width = parseInt(data.value) / parseInt(data.maximum);
width = Math.round(100 * width); width = Math.round(100 * width);
if (width > 0) { if (width) {
$('#complete').css('width', width+'%'); $('#complete').css('width', width+'%');
$('#remaining').css('width', 'auto');
}
$('#percentage').html(width+' %'); $('#percentage').html(width+' %');
} else {
$('#complete').css('width', '0.01%');
$('#percentage').html('0 %');
}
$('#remaining').css('width', 'auto');
} }
} }
}, },