From 23187d463f23d2672dee197152756d853d75e9b0 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 31 Dec 2024 09:22:27 +0100 Subject: [PATCH] =?UTF-8?q?La=20hauteur=20du=20menu=20est=20g=C3=A9r=C3=A9?= =?UTF-8?q?=20par=20lquery=20et=20non=20par=20le=20theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/router.class.php | 2 +- core/core.js.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/core/class/router.class.php b/core/class/router.class.php index 36edd76..7984def 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -268,7 +268,7 @@ class core extends common $totalHeight = $firstPadding + $fontSize + $menuFontSizeInPx; // Fixer la hauteur maximale de la barre de menu - $css .= '#menuLeft, nav, a.active {max-height:' . $totalHeight . 'px}'; + // $css .= '#menuLeft, nav, a.active {max-height:' . $totalHeight . 'px}'; // Pied de page $colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor'])); diff --git a/core/core.js.php b/core/core.js.php index 4b5fbf6..392a3f4 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -375,6 +375,17 @@ core.start = function () { // Option active var hidePages = "getData(['theme', 'menu', 'hidePages'])?>"; + // Récupérer les valeurs de dimensions + var padding = "getData(['theme', 'menu', 'height'])?>"; + var firstPadding = parseFloat(padding.split(" ")[0]); // Convertir la première valeur en nombre + var fontSize = parseFloat("getData(['theme', 'text', 'fontSize'])?>"); // Taille du texte + var menuFontSize = parseFloat("getData(['theme', 'menu', 'fontSize'])?>"); // Taille du menu + + // Convertir menuFontSize en pixels + var menuFontSizeInPx = menuFontSize * fontSize; + + // Calculer la hauteur totale + var totalHeight = firstPadding + fontSize + menuFontSizeInPx; if (hidePages == 1) { $("#menuLeft").css({ "visibility": "hidden", @@ -382,6 +393,8 @@ core.start = function () { "max-width": "10px" }); + // Par défaut pour tous les thèmes. + $("#menuLeft, nav").css("max-height", totalHeight + "px"); } };