From 46b50df44a826d975b066b17d29be61169b12594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Farr=C3=A9?= Date: Sun, 10 Nov 2024 22:26:07 +0000 Subject: [PATCH] Fix: Space menu width on mobile --- docs/CHANGELOG.md | 1 + resources/js/humhub.cleanTheme.topNavigation.js | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5d509cd..d7b6da0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -13,6 +13,7 @@ Unreleased - Fix: Ensure that the notification and messenger unread counter is round when it contains only one digit - Fix: In forms, images should not have rounded corners - Fix: Top bar when no logo or when the logo aspect ratio is very different from 1:1 +- Fix: Space menu width on mobile 2.1.0 (October 18, 2024) -------------------- diff --git a/resources/js/humhub.cleanTheme.topNavigation.js b/resources/js/humhub.cleanTheme.topNavigation.js index 3c356ab..9d2474e 100644 --- a/resources/js/humhub.cleanTheme.topNavigation.js +++ b/resources/js/humhub.cleanTheme.topNavigation.js @@ -210,17 +210,18 @@ humhub.module('cleanTheme.topNavigation', function (module, require, $) { return; } + // Reset $(window).off('scroll', switchFixedPanels); removeLeftNavFixed(); + $leftNav.css("width", ""); - $topBarHeight = $('#topbar').height(); + // Get new values + $topBarHeight = parseInt($('#topbar').css('top')) + $('#topbar').height(); $leftNavTop = $leftNav.offset().top; - // Force width to keep the same when position is fixed - $leftNav.css("width", ""); - $leftNav.width($leftNav.width()); - if ($leftNav.parent().css('float') === 'left') { + // Force width to keep the same when position when fixed + $leftNav.width($leftNav.width()); const availableHeightForSidebar = $(window).height() - $topBarHeight - leftNavDistFromTopBar; if ($leftNav.height() < availableHeightForSidebar) { switchFixedPanels();