Skip to content

Commit

Permalink
Fix css for MD theme
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 3, 2019
1 parent d751001 commit c5f5abc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions.lib.php
Expand Up @@ -7180,7 +7180,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 ' if(!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n";
print ' if (!$( "body" ).hasClass( "sidebar-collapse" )){ event.preventDefault(); }'."\n";
print ' console.log("We click on .menuhider");'."\n";
print ' $("body").toggleClass("sidebar-collapse")'."\n";
print '});'."\n";
Expand Down
12 changes: 7 additions & 5 deletions htdocs/main.inc.php
Expand Up @@ -1091,12 +1091,14 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab
// html header
top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);

//if ($conf->browser->layout == 'phone')
//{
$morecssonbody.= ' sidebar-collapse';
//}
$tmpcsstouse='sidebar-collapse'.($morecssonbody?' '.$morecssonbody:'');
// If theme MD and classic layer, we open the menulayer by default.
if ($conf->theme == 'md' && ! in_array($conf->browser->layout, array('phone','tablet')) && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$tmpcsstouse=$morecssonbody;
}

print '<body id="mainbody"'.($morecssonbody?' class="'.$morecssonbody.'"':'').'>' . "\n";
print '<body id="mainbody" class="'.$tmpcsstouse.'">' . "\n";

// top menu and left menu area
if (empty($conf->dol_hide_topmenu) || GETPOST('dol_invisible_topmenu', 'int'))
Expand Down
11 changes: 10 additions & 1 deletion htdocs/theme/md/style.css.php
Expand Up @@ -1771,6 +1771,7 @@
div.mainmenu.menu {
background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/menu.png', 1) ?>);
top: 7px;
left: 5px;
}

div.mainmenu.products {
Expand Down Expand Up @@ -1884,6 +1885,10 @@
a.tmenuimage {
display: block;
}
a.tmenuimage:focus {
outline: none;
}



/* Login */
Expand Down Expand Up @@ -5668,6 +5673,10 @@
}
}

.menuhider {
width: 40px;
}

/* nboftopmenuentries = <?php echo $nbtopmenuentries ?>, fontsize=<?php echo $fontsize ?> */
/* disableimages = <?php echo $disableimages; ?> */
/* rule to reduce top menu - 1st reduction */
Expand All @@ -5688,7 +5697,7 @@
margin-top: 0px;
}
li.tmenu, li.tmenusel {
min-width: 32px;
min-width: 34px;
}
div.mainmenu {
min-width: auto;
Expand Down

0 comments on commit c5f5abc

Please sign in to comment.