changeset 3333984a89b7 in sao:5.8
details: https://hg.tryton.org/sao?cmd=changeset&node=3333984a89b7
description:
Set table min-width using em
issue10534
review348891002
(grafted from fe016448d965347555c244a44ad08a78fb2f8c15)
diffstat:
src/view/tree.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (39 lines):
diff -r cdaea5d526e4 -r 3333984a89b7 src/view/tree.js
--- a/src/view/tree.js Wed Jun 30 12:51:04 2021 +0100
+++ b/src/view/tree.js Fri Jul 02 16:56:20 2021 +0200
@@ -654,7 +654,7 @@
var inversion = new Sao.common.DomainInversion();
domain = inversion.simplify(domain);
var decoder = new Sao.PYSON.Decoder(this.screen.context);
- var min_width = 0;
+ var min_width = [];
this.columns.forEach(function(column) {
visible_columns += 1;
var name = column.attributes.name;
@@ -699,6 +699,7 @@
var width, c_width;
if (column.width) {
width = c_width = column.width;
+ min_width.push(width + 'px');
} else {
width = {
'integer': 6,
@@ -719,15 +720,14 @@
factor += parseInt(column.attributes.expand, 10);
}
c_width = width * 100 * factor + '%';
- width *= 10;
+ min_width.push(width + 'em');
}
column.col.css('width', c_width);
- min_width += width;
column.col.show();
}
}.bind(this));
- this.table.css('min-width', min_width + 'px');
- this.scrollbar.css('min-width', min_width + 'px');
+ this.table.css('min-width', 'calc(' + min_width.join(' + ') + ')');
+ this.scrollbar.css('min-width', this.table.css('min-width'));
this.tbody.find('tr.more-row > td').attr(
'colspan', visible_columns);