Hide menu title when screen is too small

This commit is contained in:
Calvo 2022-03-23 17:55:52 +01:00
parent c9cea837fa
commit 8cae675841
3 changed files with 27 additions and 16 deletions

View File

@ -323,8 +323,6 @@ switch ($section) {
break;
}
// Put header inside div for special sizing.(No right margin).
echo '<div id="header_configuration" style="width: calc(100% + 3em);">';
// Header.
ui_print_page_header(
__('Configuration').$subpage,
@ -338,9 +336,8 @@ ui_print_page_header(
GENERIC_SIZE_TEXT,
'',
'',
true,
true
);
echo '</div>';
if (isset($config['error_config_update_config'])) {
if ($config['error_config_update_config']['correct'] == false) {

View File

@ -4632,12 +4632,7 @@ function ui_print_page_header(
$buffer .= '<div class="breadcrumbs_container">'.$breadcrumbs.'</div>';
}
if ($hide_left_small !== true) {
$buffer .= '<div id="menu_tab_left">';
} else {
$buffer .= '<div id="menu_tab_left" class="menu_hide">';
}
$buffer .= '<div id="menu_tab_left">';
$buffer .= '<ul class="mn"><li class="'.$type.'">';
if (strpos($title, 'Monitoring » Services »') != -1) {
@ -4733,6 +4728,31 @@ function ui_print_page_header(
$buffer .= '</div>';
if ($hide_left_small) {
$buffer .= '<script>
$(window).resize(function () {
hideLeftHeader()
});
$(document).ready(function () {
hideLeftHeader();
});
function hideLeftHeader() {
var right_width = 0;
$("#menu_tab").find("li").each(function(index) {
right_width += parseInt($(this).outerWidth(), 10);
});
if($("#menu_tab").outerWidth() < right_width) {
$("#menu_tab_left").children().hide()
} else {
$("#menu_tab_left").children().show();
}
}
</script>';
}
if (!$return) {
echo $buffer;
}

View File

@ -2368,12 +2368,6 @@ a.autorefresh_txt,
}
}
@media only screen and (max-width: 1200px) {
.menu_hide ul {
display: none;
}
}
.disabled_module {
color: #aaa;
}