Skip to content

Commit

Permalink
Fix: Space menu width on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-farre committed Nov 10, 2024
1 parent 12d4760 commit 46b50df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
--------------------
Expand Down
11 changes: 6 additions & 5 deletions resources/js/humhub.cleanTheme.topNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 46b50df

Please sign in to comment.