Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit ce7ddd8

Browse files
committed
fixes #4018
1 parent a65a5fa commit ce7ddd8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: src/progressbar/progressbar.js

+11
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ angular.module('ui.bootstrap.progressbar', [])
2727

2828
bar.recalculatePercentage = function() {
2929
bar.percent = +(100 * bar.value / bar.max).toFixed(2);
30+
31+
var totalPercentage = 0;
32+
self.bars.forEach(function (bar) {
33+
totalPercentage += bar.percent;
34+
});
35+
36+
if (totalPercentage > 100) {
37+
bar.percent -= totalPercentage - 100;
38+
} else if (totalPercentage < 100) {
39+
bar.percent += 100 - totalPercentage;
40+
}
3041
};
3142

3243
bar.$on('$destroy', function() {

0 commit comments

Comments
 (0)