changeset 843bb22b8778 in sao:4.6 details: https://hg.tryton.org/sao?cmd=changeset;node=843bb22b8778 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 (grafted from 12cdeec61f78c321c97309d0d1f6b449d7d096e2) diffstat: src/sao.js | 1 + src/view/tree.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diffs (28 lines): diff -r e33debff0ee7 -r 843bb22b8778 src/sao.js --- a/src/sao.js Mon Nov 12 23:41:29 2018 +0100 +++ b/src/sao.js Wed Nov 28 09:54:15 2018 +0100 @@ -453,6 +453,7 @@ Sao.main_menu_screen = form.screen; var view = form.screen.current_view; view.table.removeClass('table table-bordered table-striped'); + view.table.addClass('no-responsive'); view.table.find('thead').hide(); jQuery('#menu').children().remove(); diff -r e33debff0ee7 -r 843bb22b8778 src/view/tree.js --- a/src/view/tree.js Mon Nov 12 23:41:29 2018 +0100 +++ b/src/view/tree.js Wed Nov 28 09:54:15 2018 +0100 @@ -352,9 +352,10 @@ } }.bind(this)); - 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 {