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

Commit

Permalink
fixes #4018
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffanLong committed Jul 28, 2015
1 parent a65a5fa commit ce7ddd8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/progressbar/progressbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ angular.module('ui.bootstrap.progressbar', [])

bar.recalculatePercentage = function() {
bar.percent = +(100 * bar.value / bar.max).toFixed(2);

var totalPercentage = 0;
self.bars.forEach(function (bar) {
totalPercentage += bar.percent;
});

if (totalPercentage > 100) {
bar.percent -= totalPercentage - 100;
} else if (totalPercentage < 100) {
bar.percent += 100 - totalPercentage;
}
};

bar.$on('$destroy', function() {
Expand Down

0 comments on commit ce7ddd8

Please sign in to comment.