From 524b0cd85fbab7d4e82da61ff8376dcaf8ce5ff9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Aug 2019 12:34:18 +0200 Subject: [PATCH] FIX Mode smartphone was not triggered when there is too loo menu entries. --- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/eldy/style.css.php | 1 + htdocs/theme/md/style.css.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index f1faa731f78..36c88d31bdb 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -742,7 +742,7 @@ select.selectarrowonleft option { .hideobject { display: none; } .minwidth50 { min-width: 50px; } /* rule for not too small screen only */ -@media only screen and (min-width: px) +@media only screen and (min-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) { .width25 { width: 25px; } .width50 { width: 50px; } @@ -1058,7 +1058,7 @@ div.vmenu, td.vmenu { .menuhider { display: none !important; } /* rule to reduce top menu - 3rd reduction: The menu for user is on left */ -@media only screen and (max-width: px) /* reduction 3 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ { body.sidebar-collapse .side-nav { display: none; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index dfb180f0dad..bbf5e4e1b54 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -192,6 +192,7 @@ $colortext=join(',', colorStringToArray($colortext)); $colortextlink=join(',', colorStringToArray($colortextlink)); $nbtopmenuentries=$menumanager->showmenu('topnb'); +if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 7); $minwidthtmenu=66; /* minimum width for one top menu entry */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 86beb45dce2..154ff416110 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -195,6 +195,7 @@ $colortext=join(',', colorStringToArray($colortext)); $colortextlink=join(',', colorStringToArray($colortextlink)); $nbtopmenuentries=$menumanager->showmenu('topnb'); +if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 7); print '/*'."\n"; print 'colorbackbody='.$colorbackbody."\n";