Fixed hidden menu and preparated immovable menu

This commit is contained in:
m-lopez-f 2015-04-07 09:50:46 +02:00
parent d04575bec4
commit 878c676c76
4 changed files with 91 additions and 126 deletions

View File

@ -70,7 +70,7 @@ if (isset($config['fixed_header'])) {
<script type="text/javascript" language="javascript">
/* <![CDATA[ */
/*
var autohidden_menu = <?php echo $autohidden_menu; ?>;
var fixed_menu = <?php echo json_encode((bool)$config_fixed_menu); ?>;
var fixed_header = <?php echo json_encode((bool)$config_fixed_header); ?>;
@ -95,7 +95,6 @@ function open_submenus () {
$('div.menu>ul>li.selected>ul').removeClass('invisible');
}
function close_submenus () {
$.each(menuState, function (index, value) {
if (value)
@ -105,7 +104,7 @@ function close_submenus () {
}
$(document).ready( function() {
/*
$("img.toggle").click (function (e) {
//In case the links gets activated, we don't want to follow link
e.preventDefault();
@ -127,7 +126,7 @@ $(document).ready( function() {
$.cookie(cookie_name_encoded, JSON.stringify(menuState), {expires: 7});
});
//Cerrar aqui los comentarios cuando esté el menu terminado*/
if (fixed_menu) {
$('div#menu')
.css('position', 'fixed')
@ -158,76 +157,67 @@ $(document).ready( function() {
});
}
}
if (autohidden_menu) {
$('#menu_container').hover (handlerIn, handlerOut);
var openTime = 0;
var handsIn = 0;
$('#main').css('margin-left', '50px');
hide_menu_pretty();
function handlerIn() {
handsIn = 1;
if (openTime == 0) {
show_menu();
openTime = new Date().getTime();
// Close in 1 second if is not closed manually
setTimeout(function() {
if(openTime > 0 && handsIn == 0) {
hide_menu();
openTime = 0;
}
}, 1000);
}
}
function handlerOut() {
handsIn = 0;
var openedTime = new Date().getTime() - openTime;
if (openedTime > 1000) {
hide_menu();
openTime = 0;
}
}
function show_menu () {
function show_menu () {
$('#menu_container').animate({"left": "+=80px"}, 200, function () {
if (fixed_menu) {
$('#menu_container').parent().css('overflow', 'auto');
}
});
show_menu_pretty();
//show_menu_pretty();
}
function show_menu_pretty() {
open_submenus();
$('div.menu ul li').css('background-position', '');
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').show();
$('.titop').css('color', 'white');
$('.bg3').css('color', 'white');
$('.bg4').css('color', 'white');
function show_menu_pretty() {
open_submenus();
$('div.menu ul li').css('background-position', '');
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').show();
$('.titop').css('color', 'white');
$('.bg3').css('color', 'white');
$('.bg4').css('color', 'white');
}
function hide_menu () {
if (fixed_menu) {
$('#menu_container').parent().css('overflow', 'hidden');
}
$('#menu_container').animate({"left": "-=80px"}, 100);
//hide_menu_pretty();
}
function hide_menu_pretty() {
close_submenus();
$('div.menu li').css('background-position', '85px 5px');
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').hide();
$('.titop').css('color', $('.titop').css('background-color'));
$('.bg3').css('color', $('.bg3').css('background-color'));
$('.bg4').css('color', $('.bg4').css('background-color'));
}
if (autohidden_menu) {
//handlerIn, handlerOut);
openTime = 0;
handsIn = 0;
//$('#main').css('margin-left', '50px');
//hide_menu_pretty();
function hide_menu () {
if (fixed_menu) {
$('#menu_container').parent().css('overflow', 'hidden');
$('#menu').hover(function() {
handsIn = 1;
if (openTime == 0) {
show_menu();
openTime = new Date().getTime();
}
$('#menu_container').animate({"left": "-=80px"}, 100);
hide_menu_pretty();
}
function hide_menu_pretty() {
close_submenus();
$('div.menu li').css('background-position', '85px 5px');
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').hide();
$('.titop').css('color', $('.titop').css('background-color'));
$('.bg3').css('color', $('.bg3').css('background-color'));
$('.bg4').css('color', $('.bg4').css('background-color'));
}
}).mouseleave(function(){
handsIn = 0;
setTimeout(function() {
openedTime = new Date().getTime() - openTime;
if(openedTime > 3000 && handsIn == 0) {
hide_menu();
openTime = 0;
}
}, 3500);
});
}
});
/* ]]> */
@ -244,10 +234,13 @@ $(document).ready( function() {
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
//$('div#menu').offset().top;
//$('div#menu').css('overflow','visible');
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function(){
//$('div#menu').css('overflow', 'hidden');
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
@ -268,7 +261,7 @@ $(document).ready( function() {
if( typeof(table_noHover2) != 'undefined')
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id )
$("ul#sub"+table_noHover2[0].id).hide();
}).mouseout(function(){
}).mouseleave(function(){
table_noHover2 = table_hover2;
handsIn2 = 0;
setTimeout(function() {

View File

@ -2379,8 +2379,8 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
}
if ($godmode == true) {
$type = "nomn";
$type2 = "menu_tab_frame";
$type = "view";
$type2 = "menu_tab_frame_view";
$separator_class = "separator";
}
else {

View File

@ -265,4 +265,4 @@ ul li a {
/* End */
ul li a:hover { color: #E2144A; } /* Hover Styles */
li ul li a { padding: 2px 5px; } /* Sub Menu Styles */
/*li ul li a { padding: 2px 5px; } Sub Menu Styles */

View File

@ -305,12 +305,15 @@ div#menu_container {
-webkit-border-top-right-radius: 6px;
border-top-right-radius: 6px;
z-index: 1010;
width: 40px;
height: 100%;
}
div#menu {
width: 40px;
float: left;
margin-top: 10px;
height: 828px;
}
div#head {
@ -1108,6 +1111,7 @@ div.title_line {
position: relative;
margin: 0px 0px 0px 0px;
}
/*
#menu_tab li a, #menu_tab a {
padding: 2px 0px;
font-weight: bold;
@ -1128,36 +1132,7 @@ div.title_line {
padding-left: 7px;
padding-top: 4px;
}
#menu_tab li.tab_operation, #menu_tab li.tab_godmode {
#padding-left: 2px;
}
#menu_tab li.tab_godmode a, #menu_tab a.tab_godmode {
#background: #666;
#padding-left: 4px;
#padding-right: 4px;
#min-height: 27px;
}
#menu_tab li.tab_godmode.nomn_high a, #menu_tab a.tab_godmode.nomn_high,
#menu_tab li.tab_godmode a:hover, #menu_tab a.tab_godmode:hover {
#background: #555555;
}
#menu_tab li.tab_operation a, #menu_tab a.tab_operation {
#background: #82b92e;
#padding-left: 4px;
#padding-right: 4px;
#min-height: 27px;
}
#menu_tab li.tab_operation.nomn_high a, #menu_tab a.tab_operation.nomn_high,
#menu_tab li.tab_operation a:hover, #menu_tab a.tab_operation:hover {
#background: #3F3F3F;
}
*/
#menu_tab li.separator_view {
padding: 4px;
@ -1174,6 +1149,10 @@ div.title_line {
#menu_tab .mn li a {
display: block;
text-decoration: none;
padding: 0px;
margin: 0px;
height: 21px;
width: 21px;
}
#menu_tab li.nomn:hover a, #menu_tab li:hover ul a:hover {
/*background: #82b92e;*/
@ -1187,11 +1166,14 @@ div.title_line {
border-top: none;
}
#menu_tab li.nomn, #menu_tab li {
#menu_tab li.nomn {
min-width: 30px;
height: 28px;
}
#menu_tab li.nomn_high {
min-width: 30px;
height: 28px;
}
/* TAB TITLE */
#menu_tab_left {
margin-left: 0px !important;
@ -1231,7 +1213,7 @@ div.title_line {
display: none;
}
#menu_tab_left ul.mn li.view {
#menu_tab_left li.view {
background: #82b92e;
max-width: 40%;
min-width: 20%;
@ -1248,23 +1230,7 @@ div.title_line {
overflow-y: hidden;
}
#menu_tab_left ul.mn li.nomn {
background: #666;
max-width: 40%;
min-width: 20%;
padding: 5px 5px 0px;
-moz-border-top-right-radius: 5px;
-webkit-border-top-right-radius: 5px;
border-top-right-radius: 5px;
-moz-border-top-left-radius: 5px;
-webkit-border-top-left-radius: 5px;
border-top-left-radius: 5px;
margin-left: 0px;
}
#menu_tab_left ul.mn li.view img.bottom {
#menu_tab_left li.view img.bottom {
width: 24px;
height: 24px;
}
@ -2905,14 +2871,15 @@ table#policy_modules td * {
#menu_tab li.nomn, #menu_tab li.nomn_high {
background-color: #ECECEC;
padding: 0px 10px 3px;
font-weight: bold;
text-decoration: none;
font-size: 14px;
border-color: #E2E2E2;
border-style: solid;
border-width: 1px;
background-color: #ECECEC;
padding-right: 3px;
padding-left: 3px;
font-weight: bold;
text-decoration: none;
font-size: 14px;
border-color: #E2E2E2;
border-style: solid;
border-width: 1px;
margin-top: -10px;
}
@ -2921,6 +2888,11 @@ table#policy_modules td * {
background-color: #FFF;
}
#menu_tab li.nomn img, #menu_tab li img {
margin-top: 3px;
margin-left: 3px;
}
#menu_tab li.tab_operation a, #menu_tab a.tab_operation{
background: none !important ;
}