Fixed classic menu mode. Ticket #250

This commit is contained in:
Arturo Gonzalez 2017-02-13 13:50:28 +01:00
parent 2cfce8979e
commit 4c63756f51
1 changed files with 43 additions and 39 deletions

View File

@ -75,10 +75,17 @@ var id_user = "<?php echo $config['id_user']; ?>";
var cookie_name = id_user + '-pandora_menu_state'; var cookie_name = id_user + '-pandora_menu_state';
var cookie_name_encoded = btoa(cookie_name); var cookie_name_encoded = btoa(cookie_name);
var click_display = "<?php echo $config["click_display"]; ?>"; var click_display = "<?php echo $config["click_display"]; ?>";
var classic_menu = "<?php echo $config["classic_menu"]; ?>"; var classic_menu = parseInt("<?php echo $config["classic_menu"]; ?>");
if ((isNaN(classic_menu)) || (classic_menu == 0)) {
classic_menu = false;
}
else {
classic_menu = true;
}
if (classic_menu) { if (classic_menu) {
autohidden_menu = true; autohidden_menu = 1;
} }
var menuState = $.cookie(cookie_name_encoded); var menuState = $.cookie(cookie_name_encoded);
@ -239,6 +246,19 @@ $(document).ready( function() {
$('#menu').css('position', 'block'); $('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" ); $('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px'); $('ul.submenu').css('left', '144px');
$('#menu').mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '145px');
$('#menu').css('position', 'block');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}
}, 2500);
});
} }
else { else {
if(!click_display){ if(!click_display){
@ -289,26 +309,6 @@ $(document).ready( function() {
}); });
} }
} }
/*$('#menu').mouseenter(function() {
$('div#title_menu').show();
handsInMenu = 1;
openTimeMenu = new Date().getTime();
$('#menu').css('width', '145px');
$('li.menu_icon').addClass( " no_hidden_menu" );
$('ul.submenu').css('left', '144px');
}).mouseleave(function() {
handsInMenu = 0;
setTimeout(function() {
openedMenu = new Date().getTime() - openTimeMenu;
if(openedMenu > 1000 && handsInMenu == 0) {
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
}
}, 1500);
});*/
} }
else { else {
$('div#title_menu').hide(); $('div#title_menu').hide();
@ -465,23 +465,27 @@ $(document).ready( function() {
//Daniel maya 02/06/2016 Display menu with click --END //Daniel maya 02/06/2016 Display menu with click --END
} }
else { else {
$('#container').click(function() { if(!click_display){
openTime = 4000; $('#container').click(function() {
if( typeof(table_hover) != 'undefined') openTime = 4000;
$("ul#sub"+table_hover[0].id).hide(); if( typeof(table_hover) != 'undefined')
if( typeof(table_hover2) != 'undefined') $("ul#sub"+table_hover[0].id).hide();
$("ul#sub"+table_hover2[0].id).hide(); if( typeof(table_hover2) != 'undefined')
$('ul.submenu').css('left', '144px'); $("ul#sub"+table_hover2[0].id).hide();
}); $('#menu').css('width', '145px');
$('ul.submenu').css('left', '144px');
$('#main').click(function() { });
openTime = 4000; }else{
if( typeof(table_hover) != 'undefined') $('#main').click(function() {
$("ul#sub"+table_hover[0].id).hide(); openTime = 4000;
if( typeof(table_hover2) != 'undefined') if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide(); $("ul#sub"+table_hover[0].id).hide();
$('ul.submenu').css('left', '144px'); if( typeof(table_hover2) != 'undefined')
}); $("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '145px');
$('ul.submenu').css('left', '144px');
});
}
} }
if (classic_menu) { if (classic_menu) {