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
|
@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue