Restructure the flat 7-item navbar into logical dropdown groups (Transactions, Receipts, Accounts), add a prominent Upload button, settings gear icon, breadcrumb navigation on 11 deep pages, and dashboard quick-action cards with hover effects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
957 B
JavaScript
20 lines
957 B
JavaScript
// Highlight active dropdown parent when a child page is active
|
|
(function () {
|
|
var path = window.location.pathname.toLowerCase().replace(/\/+$/, '') || '/';
|
|
document.querySelectorAll('.navbar .dropdown-menu .dropdown-item').forEach(function (item) {
|
|
var href = (item.getAttribute('href') || '').toLowerCase().replace(/\/+$/, '');
|
|
if (href && (path === href || path.startsWith(href + '/'))) {
|
|
item.classList.add('active');
|
|
var toggle = item.closest('.dropdown').querySelector('.dropdown-toggle');
|
|
if (toggle) toggle.classList.add('active-parent');
|
|
}
|
|
});
|
|
// Direct nav-links (non-dropdown)
|
|
document.querySelectorAll('.navbar .nav-link:not(.dropdown-toggle)').forEach(function (link) {
|
|
var href = (link.getAttribute('href') || '').toLowerCase().replace(/\/+$/, '');
|
|
if (href && path === href) {
|
|
link.classList.add('active');
|
|
}
|
|
});
|
|
})();
|