FIX regression with option to hide picto on top menu

This commit is contained in:
Laurent Destailleur 2019-09-15 15:09:36 +02:00
parent f946ec0563
commit 544a1237bc
3 changed files with 89 additions and 10 deletions

View File

@ -7226,7 +7226,7 @@ function printCommonFooter($zone = 'private')
{
print "\n";
print '/* JS CODE TO ENABLE to manage handler to switch left menu page (menuhider) */'."\n";
print 'jQuery(".menuhider").click(function(event) {';
print 'jQuery("li.menuhider").click(function(event) {';
print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n";
print ' console.log("We click on .menuhider");'."\n";
print ' $("body").toggleClass("sidebar-collapse")'."\n";

View File

@ -1026,6 +1026,41 @@ div.blockvmenulogo
{
border-bottom: 0 !important;
}
.backgroundforcompanylogo {
margin: <?php echo $disableimages?'0':'6'; ?>px;
margin-left: 6px;
margin-right: 8px;
background-color: rgba(255,255,255,0.7);
padding: 0;
border-radius: 5px;
height: <?php echo $disableimages?'20':'32'; ?>px;
/* width: 100px; */
max-width: 100px;
vertical-align: middle;
}
.backgroundforcompanylogo img.mycompany {
object-fit: contain;
width: inherit;
height: inherit;
}
#mainmenutd_companylogo::after, #mainmenutd_menu::after {
content: unset !important;
}
li#mainmenutd_companylogo .tmenucenter {
width: unset;
}
li#mainmenutd_companylogo {
min-width: unset !important;
}
<?php if ($disableimages) { ?>
li#mainmenutd_home {
min-width: unset !important;
}
li#mainmenutd_home .tmenucenter {
width: unset;
}
<?php } ?>
div.blockvmenupair, div.blockvmenuimpair {
border-top: none !important;
border-left: none !important;
@ -1469,9 +1504,6 @@ li.tmenu, li.tmenusel {
li.menuhider:hover {
background-image: none !important;
}
li.tmenusel, li.tmenu:hover {
/* background: rgba(0, 0, 0, 0.1); */
}
li.tmenusel::after, li.tmenu:hover::after{
content: "";
@ -1524,7 +1556,7 @@ div.tmenucenter
padding-top: 2px;
height: <?php print $heightmenu; ?>px;
<?php } ?>
width: 100%;
/* width: 100%; */
}
#menu_titre_logo {
padding-top: 0;
@ -1930,8 +1962,8 @@ div.login_block_other { padding-top: 0; text-align: right; margin-right: 8px; }
float: right;
vertical-align: top;
padding: 0px 3px 0px 4px !important;
line-height: 50px;
height: 50px;
line-height: <?php echo $disableimages?'25':'50'; ?>px;
height: <?php echo $disableimages?'25':'50'; ?>px;
}
.atoplogin, .atoplogin:hover {
color: #<?php echo $colortextbackhmenu; ?> !important;
@ -1968,8 +2000,8 @@ img.login, img.printer, img.entity {
font-weight: bold;
}
.userimg.atoplogin img.userphoto, .userimgatoplogin img.userphoto { /* size for user photo in login bar */
width: 32px;
height: 32px;
width: <?php echo $disableimages?'26':'32'; ?>px;
height: <?php echo $disableimages?'26':'32'; ?>px;
border-radius: 50%;
background-size: contain;
background-size: contain;
@ -5621,6 +5653,9 @@ div.tabsElem a.tab {
/* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */
{
li.tmenucompanylogo {
display: none;
}
div.mainmenu {
height: 23px;
}

View File

@ -1938,6 +1938,11 @@ foreach($mainmenuusedarray as $val)
display: none;
<?php } ?>
}
.topmenuimage {
<?php if ($disableimages) { ?>
display: none;
<?php } ?>
}
a.tmenuimage {
display: block;
}
@ -2222,6 +2227,41 @@ div.blockvmenulogo
{
border-bottom: 0 !important;
}
.backgroundforcompanylogo {
margin: <?php echo $disableimages?'0':'6'; ?>px;
margin-left: 12px;
margin-right: 6px;
background-color: rgba(255,255,255,0.7);
padding: 0;
border-radius: 5px;
height: <?php echo $disableimages?'20':'32'; ?>px;
/* width: 100px; */
max-width: 100px;
vertical-align: middle;
}
.backgroundforcompanylogo img.mycompany {
object-fit: contain;
width: inherit;
height: inherit;
}
#mainmenutd_companylogo::after {
content: unset;
}
li#mainmenutd_companylogo .tmenucenter {
width: unset;
}
li#mainmenutd_companylogo {
min-width: unset !important;
}
<?php if ($disableimages) { ?>
li#mainmenutd_home {
min-width: unset !important;
}
li#mainmenutd_home .tmenucenter {
width: unset;
}
<?php } ?>
div.blockvmenupair, div.blockvmenuimpair
{
font-family: <?php print $fontlist ?>;
@ -5743,7 +5783,7 @@ border-top-right-radius: 6px;
}
.menuhider {
width: 40px;
width: <?php echo $disableimages ? 'auto' : '40'; ?>px;
}
/* nboftopmenuentries = <?php echo $nbtopmenuentries ?>, fontsize=<?php echo $fontsize ?> */
@ -5778,6 +5818,10 @@ border-top-right-radius: 6px;
/* rule to reduce top menu - 2nd reduction */
@media only screen and (max-width: <?php echo round($nbtopmenuentries * $fontsize * 4.5, 0) + 200; ?>px)
{
li.tmenucompanylogo {
display: none;
}
div.tmenucenter {
max-width: <?php echo round($fontsize * 2); ?>px; /* size of viewport */
text-overflow: clip;