From 43edc82cbeb54733192d8ad29ccce7fbe61b2b37 Mon Sep 17 00:00:00 2001
From: Alex <40072887+alexdcrane@users.noreply.github.com>
Date: Wed, 12 Mar 2025 12:15:38 -0700
Subject: [PATCH] Fix header user menu when using inline or static menu style
(#7306)
* Fix header user menu when using inline or static menu
* Update template.php
---
themes/default/css.php | 82 +++++++++++++++++++------------------
themes/default/template.php | 22 +++++-----
2 files changed, 52 insertions(+), 52 deletions(-)
diff --git a/themes/default/css.php b/themes/default/css.php
index ec99abbf21..5a49932170 100644
--- a/themes/default/css.php
+++ b/themes/default/css.php
@@ -1099,46 +1099,6 @@ else { //default: white
-moz-box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
}
-
- div#body_header a {
- color: =$body_header_text_link_color?>;
- }
-
- div#body_header a:hover {
- color: =$body_header_text_link_color_hover?>;
- text-decoration: none;
- }
-
- div#body_header_user_menu {
- z-index: 6;
- display: none;
- position: absolute;
- top: 50px;
- /* right: specified in /resources/classes/menu.php */
- padding: 15px;
- background-color: =$body_header_background_color?>;
- border: 1px solid =color_adjust($body_header_shadow_color, 0.05)?>;
-
- -webkit-border-radius: ;
- -moz-border-radius: ;
- border-radius: ;
-
- -webkit-box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
- -moz-box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
- box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
- }
-
- @media (max-width: 575.98px) {
- div#body_header_user_menu {
- width: calc(100% - 20px);
- /* right: specified in /resources/classes/menu.php */
- }
- }
-
- div#body_header_user_menu a {
- font-size: 90%;
- text-decoration: none;
- }
div#body_header {
padding: 10px;
@@ -1150,6 +1110,48 @@ else { //default: white
}
+ div#body_header a {
+ color: =$body_header_text_link_color?>;
+ }
+
+ div#body_header a:hover {
+ color: =$body_header_text_link_color_hover?>;
+ text-decoration: none;
+ }
+
+ div#body_header_user_menu {
+ z-index: 6;
+ display: none;
+ position: absolute;
+
+ top: 50px;
+
+ /* right: specified in /resources/classes/menu.php */
+ padding: 15px;
+ background-color: =$body_header_background_color?>;
+ border: 1px solid =color_adjust($body_header_shadow_color, 0.05)?>;
+
+ -webkit-border-radius: ;
+ -moz-border-radius: ;
+ border-radius: ;
+
+ -webkit-box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
+ -moz-box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
+ box-shadow: 0 2px =$body_header_shadow_size ?? '7px'?> =$body_header_shadow_color?>;
+ }
+
+ @media (max-width: 575.98px) {
+ div#body_header_user_menu {
+ width: calc(100% - 20px);
+ /* right: specified in /resources/classes/menu.php */
+ }
+ }
+
+ div#body_header_user_menu a {
+ font-size: 90%;
+ text-decoration: none;
+ }
+
div#body_header_brand_image {
display: inline-block;
margin-left: 8px;
diff --git a/themes/default/template.php b/themes/default/template.php
index d7549e75bb..af91ffd346 100644
--- a/themes/default/template.php
+++ b/themes/default/template.php
@@ -20,7 +20,7 @@
-
+
{*//link to custom css file *}
{if !empty($settings.theme.custom_css)}
@@ -687,17 +687,15 @@
{/literal}
{/if}
- //side/fixed menu: hide an open user menu in the body header or menu on scroll
- {if $settings.theme.menu_style == 'side' || $settings.theme.menu_style == 'fixed' }
- {literal}
- $(window).on('scroll', function() {
- $('#body_header_user_menu').fadeOut(200);
- });
- $('div#main_content').on('click', function() {
- $('#body_header_user_menu').fadeOut(200);
- });
- {/literal}
- {/if}
+ //hide an open user menu in the body header or menu on scroll
+ {literal}
+ $(window).on('scroll', function() {
+ $('#body_header_user_menu').fadeOut(200);
+ });
+ $('div#main_content').on('click', function() {
+ $('#body_header_user_menu').fadeOut(200);
+ });
+ {/literal}
//create function to mimic toggling fade and slide at the same time
{literal}