Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/skins/classic/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ function getNormalNavBarHTML($running, $user, $bandwidth_options, $view, $skin)
</nav><!-- End First Navbar -->

<nav class="navbar navbar-expand-md justify-content-center" id="navbar-two"
<?php echo ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'down' ) ? 'style="display:none;"' : '' ?>
<?php echo ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'hidden' ) ? 'style="display:none;"' : '' ?>
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new cookie value check only hides #navbar-two when zmHeaderFlip == 'hidden'. Users with an existing cookie from previous versions (down was used to indicate the hidden state) will now get the navbar shown unexpectedly and can end up with icon/state mismatches. Consider treating legacy values (e.g., down) as equivalent to hidden, or migrating/clearing the cookie.

Suggested change
<?php echo ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'hidden' ) ? 'style="display:none;"' : '' ?>
<?php echo ( isset($_COOKIE['zmHeaderFlip']) && ( $_COOKIE['zmHeaderFlip'] == 'hidden' || $_COOKIE['zmHeaderFlip'] == 'down' ) ) ? 'style="display:none;"' : '' ?>

Copilot uses AI. Check for mistakes.
>
<div class="container-fluid" id="panel">
<?php
Expand Down Expand Up @@ -889,7 +889,7 @@ function getMapHTML($view) {
function getHeaderFlipHTML() {
$result = '';

$header = ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'down') ? 'down' : 'up';
$header = ( isset($_COOKIE['zmHeaderFlip']) and $_COOKIE['zmHeaderFlip'] == 'shown') ? 'down' : 'right';
$result .= '<li id="getHeaderFlipHTML" class="nav-item dropdown"><a class="nav-link" href="#"><i id="flip" class="material-icons md-18" style="display: inline-block;">keyboard_arrow_' .$header. '</i></a></li>'.PHP_EOL;
Comment on lines +892 to 893
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getHeaderFlipHTML() defaults the chevron to right unless the cookie is explicitly 'shown'. With no cookie set (first visit) the navbar is rendered visible, but the icon will indicate the collapsed state. Consider defaulting to down when the navbar is visible (e.g., when cookie is not 'hidden'), and also mapping legacy values (up/down) appropriately.

Copilot uses AI. Check for mistakes.

return $result;
Expand Down
10 changes: 5 additions & 5 deletions web/skins/classic/js/skin.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,12 @@ if ( currentView != 'none' && currentView != 'login' ) {
function navbarTwoFlip() {
$j("#navbar-two").slideToggle("slow");
const flip = $j("#flip");
if ( flip.html() == 'keyboard_arrow_up' ) {
flip.html('keyboard_arrow_down');
setCookie('zmHeaderFlip', 'down');
if ( flip.html() == 'keyboard_arrow_down' ) {
flip.html('keyboard_arrow_right');
setCookie('zmHeaderFlip', 'hidden');
} else {
flip.html('keyboard_arrow_up');
setCookie('zmHeaderFlip', 'up');
flip.html('keyboard_arrow_down');
setCookie('zmHeaderFlip', 'shown');
Comment on lines 301 to +309
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

navbarTwoFlip() decides which icon/cookie to set based on the current icon text (flip.html()). If a user arrives with no zmHeaderFlip cookie (or legacy values like up/down), the server-rendered icon/state can be out of sync with the actual #navbar-two visibility, causing the toggle to persist the wrong cookie value and display the wrong chevron. Consider basing the logic on #navbar-two's actual visibility (before toggling) and/or treating legacy cookie values (down => hidden, up/unset => shown) as aliases when computing the next state.

Copilot uses AI. Check for mistakes.
}
}

Expand Down