[FIX] web: kanban progressbar css fixup

fixup of dc253ff1c6
This commit is contained in:
Lucas Perais (lpe)
2018-08-01 14:24:54 +02:00
parent f9e0f6663f
commit e35a972639
@@ -133,6 +133,7 @@ var KanbanColumnProgressBar = Widget.extend({
// Display and animate the progress bars
var barNumber = 0;
var barMinWidth = 6; // In %
_.each(self.colors, function (val, key) {
var $bar = self.$bars[val];
var count = self.subgroupCounts && self.subgroupCounts[key] || 0;
@@ -159,16 +160,15 @@ var KanbanColumnProgressBar = Widget.extend({
$bar.addClass('o_bar_has_records');
// Make sure every bar that has records has some space
// and that everything adds up to 100%
var minWidth = 6*barNumber;
var maxWidth = 100 - minWidth;
var maxWidth = 100 - barMinWidth * barNumber;
self.$('.progress-bar.o_bar_has_records').css('max-width', maxWidth + '%');
self.$('.progress-bar.o_bar_has_records').css('min-width', minWidth + '%');
$bar.css('width', (count * 100 / self.groupCount) + '%');
barNumber++;
} else {
$bar.css('width', '');
}
});
this.$('.progress-bar.o_bar_has_records').css('min-width', barMinWidth + '%');
// Display and animate the counter number
var start = this.prevTotalCounterValue;