changeset 12cdeec61f78 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=12cdeec61f78
description:
        Do not use is visible to count non invisible columns

        If the table is hidden by a tab, all the headers are invisible and the
        responsive class is not correctly set.
        We need to have a special class for the menu to avoid responsive 
behavior
        because it has two columns even if the thead is invisible.

        issue7849
        review50621002
diffstat:

 src/sao.js       |  1 +
 src/view/tree.js |  7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 757564333e8b -r 12cdeec61f78 src/sao.js
--- a/src/sao.js        Wed Nov 07 19:18:39 2018 +0100
+++ b/src/sao.js        Wed Nov 28 09:54:15 2018 +0100
@@ -686,6 +686,7 @@
         form.view_prm.done(function() {
             var view = form.screen.current_view;
             view.table.removeClass('table table-bordered table-striped');
+            view.table.addClass('no-responsive');
             view.table.find('thead').hide();
             var gs = new Sao.GlobalSearch();
             jQuery('#global-search').children().remove();
diff -r 757564333e8b -r 12cdeec61f78 src/view/tree.js
--- a/src/view/tree.js  Wed Nov 07 19:18:39 2018 +0100
+++ b/src/view/tree.js  Wed Nov 28 09:54:15 2018 +0100
@@ -443,9 +443,10 @@
             this.tbody.find('tr.more-row > td').attr(
                 'colspan', visible_columns);
 
-            if (this.columns.filter(function(c) {
-                return c.header.is(':visible');
-            }).length > 1) {
+            if (!this.table.hasClass('no-responsive') &
+                (this.columns.filter(function(c) {
+                    return !c.header.hasClass('invisible');
+                }).length > 1)) {
                 this.table.addClass('responsive');
                 this.table.addClass('responsive-header');
             } else {

Reply via email to