From 1437c5a0e708e4c563dc5feccab87e8425752ff6 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Thu, 2 Feb 2023 13:28:48 +0100 Subject: [PATCH] #9663 menu redesing 3 --- pandora_console/general/new_main_menu.php | 45 +++++++++----- pandora_console/include/functions_menu.php | 3 + pandora_console/include/styles/menu2.css | 70 ++++++++++++++++++---- pandora_console/include/styles/pandora.css | 1 - 4 files changed, 92 insertions(+), 27 deletions(-) diff --git a/pandora_console/general/new_main_menu.php b/pandora_console/general/new_main_menu.php index b60fa1fd0f..f41c42a77e 100644 --- a/pandora_console/general/new_main_menu.php +++ b/pandora_console/general/new_main_menu.php @@ -77,7 +77,7 @@ echo '
'; require 'operation/menu.php'; echo '
'; -echo ''; $('#div_management').css('display', 'block'); }) + const id_selected = ''; + if (id_selected != '') { + $(`ul#subicon_${id_selected}`).show(); + // Arrow. + $(`#icon_${id_selected}`).children().first().children().last().removeClass('arrow_menu_down'); + $(`#icon_${id_selected}`).children().first().children().last().addClass('arrow_menu_up'); + // Span. + $(`#icon_${id_selected}`).children().first().children().eq(1).addClass('span_selected'); + } + var click_display = ""; $('.title_menu_classic').click(function() { - if (typeof(table_hover) != 'undefined') { - $("ul#sub" + table_hover[0].id).hide(); + const table_hover = $(this).parent(); + const id = table_hover[0].id; + const classes = $(`#${id}`).attr('class'); + + if (classes.includes('selected') === true) { + $(`#${id}`).removeClass('selected'); + $(`ul#sub${id}`).hide(); // Arrow. table_hover.children().first().children().last().removeClass('arrow_menu_up'); table_hover.children().first().children().last().addClass('arrow_menu_down'); // Span. table_hover.children().first().children().eq(1).removeClass('span_selected'); - if (table_hover[0].id == $(this).parent()[0].id) { - table_hover = undefined; - return; - } + } else { + $(`#${id}`).addClass('selected'); + $(`ul#sub${id}`).show(); + // Arrow. + $(this).children().last().removeClass('arrow_menu_down'); + $(this).children().last().addClass('arrow_menu_up'); + // Span. + $(this).children().eq(1).addClass('span_selected'); } - - table_hover = $(this).parent(); - handsIn = 1; - $("ul#sub" + table_hover[0].id).show(); - // Arrow. - $(this).children().last().removeClass('arrow_menu_down'); - $(this).children().last().addClass('arrow_menu_up'); - // Span. - $(this).children().eq(1).addClass('span_selected'); }); $('.has_submenu').click(function() { if (typeof(table_hover2) != 'undefined') { + $(`#${table_hover2[0].id}`).css("background-color", ""); $("#sub" + table_hover2[0].id).hide(); // Arrow. table_hover2.children().first().children().last().removeClass('arrow_menu_up'); @@ -150,6 +161,8 @@ echo '
'; table_hover2 = $(this); handsIn2 = 1; + + $(`#${table_hover2[0].id}`).css("background-color", "#eff2f2"); $("#sub" + table_hover2[0].id).show(); // Arrow. table_hover2.children().first().children().last().removeClass('arrow_menu_down'); diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 3f882916b2..47e55624e6 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -48,6 +48,8 @@ function menu_print_menu(&$menu) global $config; global $menuTypeClass; global $tab_active; + global $menu1_selected; + global $menu2_selected; static $idcounter = 0; echo '