changeset 81f0f9deb4cd in sao:6.0
details: https://hg.tryton.org/sao?cmd=changeset&node=81f0f9deb4cd
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 711db87b2255 -r 81f0f9deb4cd 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
@@ -655,7 +655,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;
@@ -700,6 +700,7 @@
                     var width, c_width;
                     if (column.width) {
                         width = c_width = column.width;
+                        min_width.push(width + 'px');
                     } else {
                         width = {
                             'integer': 6,
@@ -720,15 +721,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);
 

Reply via email to