diff --git a/core/core.js.php b/core/core.js.php index 71d02d7..868effd 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -555,7 +555,9 @@ $(document).ready(function(){ $(window).on("resize", function() { if( $(window).width() > 768 ){ $.each(parentPage, function(index, value) { + $('.' + value).css('min-width', 'getData(['theme', 'menu', 'minWidhtParent']); ?>'); $('.navSub .'+value).css('width', $('.'+value).css('width')); + $('.' + value).css('text-align', 'left'); }); } }).trigger("resize"); diff --git a/core/module/theme/lang/en/lex_theme.php b/core/module/theme/lang/en/lex_theme.php index d2795ab..446b3a8 100644 --- a/core/module/theme/lang/en/lex_theme.php +++ b/core/module/theme/lang/en/lex_theme.php @@ -226,6 +226,8 @@ $text['core_theme_view']['menu'][33] = 'Proportional to that defined in the site $text['core_theme_view']['menu'][34] = 'Style'; $text['core_theme_view']['menu'][35] = 'Character case'; $text['core_theme_view']['menu'][36] = 'Automatic background color'; +$text['core_theme_view']['menu'][37] = 'Minimum width of a parent tab'; +$text['core_theme_view']['menu'][38] = 'The submenu has a width imposed by the width of the parent tab, this selection sets a minimum width of the parent tab.'; $text['core_theme_view']['site'][0] = 'Back'; $text['core_theme_view']['site'][1] = 'Help'; $text['core_theme_view']['site'][2] = 'Save'; @@ -513,4 +515,12 @@ $typeAddFont = [ //'link' => 'Fichier externe avec link', //'import' => 'Fichier externe avec import' ]; +$minWidthParent = [ + 'none' => 'free', + '50px' => '50px', + '100px' => '100px', + '120px' => '120px', + '150px' => '150px', + '200px' => '200px' +]; ?> \ No newline at end of file diff --git a/core/module/theme/lang/fr/lex_theme.php b/core/module/theme/lang/fr/lex_theme.php index 2edb1b2..8bdabfd 100644 --- a/core/module/theme/lang/fr/lex_theme.php +++ b/core/module/theme/lang/fr/lex_theme.php @@ -226,6 +226,8 @@ $text['core_theme_view']['menu'][33] = 'Proportionnelle à celle définie dans l $text['core_theme_view']['menu'][34] = 'Style'; $text['core_theme_view']['menu'][35] = 'Casse'; $text['core_theme_view']['menu'][36] = 'Couleur de fond automatique'; +$text['core_theme_view']['menu'][37] = 'Largeur minimale d\'un onglet parent'; +$text['core_theme_view']['menu'][38] = 'Le sous-menu a une largeur imposée par celle de l\'onglet parent, cette sélection permet de définir une largeur minimale de l\'onglet parent.'; $text['core_theme_view']['site'][0] = 'Retour'; $text['core_theme_view']['site'][1] = 'Aide'; $text['core_theme_view']['site'][2] = 'Enregistrer'; @@ -512,4 +514,12 @@ $typeAddFont = [ //'link' => 'Fichier externe avec link', //'import' => 'Fichier externe avec import' ]; +$minWidthParent = [ + 'none' => 'libre', + '50px' => '50px', + '100px' => '100px', + '120px' => '120px', + '150px' => '150px', + '200px' => '200px' +]; ?> \ No newline at end of file diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 8fb5379..c370a62 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -545,7 +545,8 @@ class theme extends common { 'burgerLogo' => $this->getInput('themeMenuBurgerLogo'), 'burgerContent' => $this->getInput('themeMenuBurgerContent'), 'burgerTextColor' => $this->getInput('themeMenuBurgerTextColor'), - 'burgerFontSize' => $this->getInput('themeMenuBurgerFontSize') + 'burgerFontSize' => $this->getInput('themeMenuBurgerFontSize'), + 'minWidhtParent' => $this->getInput('themeMenuMinWidthParent'), ]]); // Valeurs en sortie diff --git a/core/module/theme/view/menu/menu.js.php b/core/module/theme/view/menu/menu.js.php index 7b57bf2..eb95e52 100644 --- a/core/module/theme/view/menu/menu.js.php +++ b/core/module/theme/view/menu/menu.js.php @@ -122,7 +122,7 @@ $("input, select").on("change", function() { $("nav").show().prependTo("#site"); break; } - + // Largeur étendue if ($("#themeMenuWide").val() === 'none') { $("#menu").removeClass(); @@ -140,6 +140,18 @@ $("input, select").on("change", function() { }); + +// Aperçu pour la largeur minimale de l'onglet parent +$("#themeMenuMinWidthParent").on("change", function() { + if( $(window).width() > 768 ){ + $.each(parentPage, function(index, value) { + $('.' + value).css('min-width', $("#themeMenuMinWidthParent").val()); + $('.navSub .'+value).css('width', $('.'+value).css('width')); + $('.' + value).css('text-align', 'left'); + }); + } +}).trigger("change"); + // // Lien de connexion (addClass() et removeClass() au lieu de hide() et show() car ils ne conservent pas le display-inline: block; de #themeMenuLoginLink) $("#themeMenuLoginLink").on("change", function() { diff --git a/core/module/theme/view/menu/menu.php b/core/module/theme/view/menu/menu.php index cdfc6a7..ed01321 100644 --- a/core/module/theme/view/menu/menu.php +++ b/core/module/theme/view/menu/menu.php @@ -54,36 +54,45 @@ echo template::formOpen('themeMenuForm'); ?>
-
+
$text['core_theme_view']['menu'][6], 'selected' => $this->getData(['theme', 'menu', 'radius']), 'help' => $text['core_theme_view']['menu'][7] ]); ?>
-
+
$text['core_theme_view']['menu'][8], 'selected' => $this->getData(['theme', 'menu', 'height']) ]); ?>
-
+
$text['core_theme_view']['menu'][9], 'selected' => $this->getData(['theme', 'menu', 'textAlign']) ]); ?>
+
+ $text['core_theme_view']['menu'][37], + 'help' => $text['core_theme_view']['menu'][38], + 'selected' => $this->getData(['theme', 'menu', 'minWidhtParent']) + ]); ?> +
-
- $this->getData(['theme', 'menu', 'margin']) - ]); ?> -
-
- $this->getData(['theme', 'menu', 'fixed']) - ]); ?> -
+
+
+ $this->getData(['theme', 'menu', 'margin']) + ]); ?> +
+
+ $this->getData(['theme', 'menu', 'fixed']) + ]); ?> +
+