Fix/admin cluster submenu (#12677)

* admin: fix cluster submenu toggle

* admin: update embedded JavaScript

* admin: drop the object store submenu handlers

The sidebar no longer renders an object store submenu, so its expand,
link and toggle handlers match nothing; the toggle handler repeated the
manual collapse that fought Bootstrap on the cluster submenu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: ivan <i.stepanov@navigine.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-11-16 16:13:18 -08:00
1 parent 1e31c6dbf5
commit f4e638fa1d
2 files changed
-70

No files matched your search

-70
View File
@@ -129,21 +129,6 @@ function setupSubmenuBehavior() {
}
}
// If we're on an object store page, expand the object store submenu
if (currentPathStartsWith('/object-store/')) {
const objectStoreSubmenu = document.getElementById('objectStoreSubmenu');
if (objectStoreSubmenu) {
objectStoreSubmenu.classList.add('show');
// Update the parent toggle button state
const toggleButton = document.querySelector('[data-bs-target="#objectStoreSubmenu"]');
if (toggleButton) {
toggleButton.classList.remove('collapsed');
toggleButton.setAttribute('aria-expanded', 'true');
}
}
}
// Prevent submenu from collapsing when clicking on submenu items
const clusterSubmenuLinks = document.querySelectorAll('#clusterSubmenu .nav-link');
clusterSubmenuLinks.forEach(function (link) {
@@ -152,61 +137,6 @@ function setupSubmenuBehavior() {
e.stopPropagation();
});
});
const objectStoreSubmenuLinks = document.querySelectorAll('#objectStoreSubmenu .nav-link');
objectStoreSubmenuLinks.forEach(function (link) {
link.addEventListener('click', function (e) {
// Don't prevent the navigation, just stop the collapse behavior
e.stopPropagation();
});
});
// Handle the main cluster toggle
const clusterToggle = document.querySelector('[data-bs-target="#clusterSubmenu"]');
if (clusterToggle) {
clusterToggle.addEventListener('click', function (e) {
e.preventDefault();
const submenu = document.getElementById('clusterSubmenu');
const isExpanded = submenu.classList.contains('show');
if (isExpanded) {
// Collapse
submenu.classList.remove('show');
this.classList.add('collapsed');
this.setAttribute('aria-expanded', 'false');
} else {
// Expand
submenu.classList.add('show');
this.classList.remove('collapsed');
this.setAttribute('aria-expanded', 'true');
}
});
}
// Handle the main object store toggle
const objectStoreToggle = document.querySelector('[data-bs-target="#objectStoreSubmenu"]');
if (objectStoreToggle) {
objectStoreToggle.addEventListener('click', function (e) {
e.preventDefault();
const submenu = document.getElementById('objectStoreSubmenu');
const isExpanded = submenu.classList.contains('show');
if (isExpanded) {
// Collapse
submenu.classList.remove('show');
this.classList.add('collapsed');
this.setAttribute('aria-expanded', 'false');
} else {
// Expand
submenu.classList.add('show');
this.classList.remove('collapsed');
this.setAttribute('aria-expanded', 'true');
}
});
}
}
// Mobile sidebar toggle and backdrop behavior