From 4c63756f51fa83787f30715b106586a68745527e Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Mon, 13 Feb 2017 13:50:28 +0100 Subject: [PATCH] Fixed classic menu mode. Ticket #250 --- pandora_console/general/main_menu.php | 82 ++++++++++++++------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index 0cfd1387b3..8f07228b39 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -75,10 +75,17 @@ var id_user = ""; var cookie_name = id_user + '-pandora_menu_state'; var cookie_name_encoded = btoa(cookie_name); var click_display = ""; -var classic_menu = ""; +var classic_menu = parseInt(""); + +if ((isNaN(classic_menu)) || (classic_menu == 0)) { + classic_menu = false; +} +else { + classic_menu = true; +} if (classic_menu) { - autohidden_menu = true; + autohidden_menu = 1; } var menuState = $.cookie(cookie_name_encoded); @@ -239,6 +246,19 @@ $(document).ready( function() { $('#menu').css('position', 'block'); $('li.menu_icon').addClass( " no_hidden_menu" ); $('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 { 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 { $('div#title_menu').hide(); @@ -465,23 +465,27 @@ $(document).ready( function() { //Daniel maya 02/06/2016 Display menu with click --END } else { - $('#container').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('ul.submenu').css('left', '144px'); - }); - - $('#main').click(function() { - openTime = 4000; - if( typeof(table_hover) != 'undefined') - $("ul#sub"+table_hover[0].id).hide(); - if( typeof(table_hover2) != 'undefined') - $("ul#sub"+table_hover2[0].id).hide(); - $('ul.submenu').css('left', '144px'); - }); + if(!click_display){ + $('#container').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('#menu').css('width', '145px'); + $('ul.submenu').css('left', '144px'); + }); + }else{ + $('#main').click(function() { + openTime = 4000; + if( typeof(table_hover) != 'undefined') + $("ul#sub"+table_hover[0].id).hide(); + if( typeof(table_hover2) != 'undefined') + $("ul#sub"+table_hover2[0].id).hide(); + $('#menu').css('width', '145px'); + $('ul.submenu').css('left', '144px'); + }); + } } if (classic_menu) {