- Implemented NPV comparison chart generation using Plotly in ReportingService. - Added distribution histogram for Monte Carlo results. - Updated reporting templates to include new charts and improved layout. - Created new settings and currencies management pages. - Enhanced sidebar navigation with dynamic URL handling. - Improved CSS styles for chart containers and overall layout. - Added new simulation and theme settings pages with placeholders for future features.
54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
// Navigation chevron buttons logic
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
const navPrev = document.getElementById("nav-prev");
|
|
const navNext = document.getElementById("nav-next");
|
|
|
|
if (!navPrev || !navNext) return;
|
|
|
|
// Define the navigation order (main pages)
|
|
const navPages = [
|
|
window.NAVIGATION_URLS.dashboard,
|
|
window.NAVIGATION_URLS.projects,
|
|
window.NAVIGATION_URLS.imports,
|
|
window.NAVIGATION_URLS.simulations,
|
|
window.NAVIGATION_URLS.reporting,
|
|
window.NAVIGATION_URLS.settings,
|
|
];
|
|
|
|
const currentPath = window.location.pathname;
|
|
|
|
// Find current index
|
|
let currentIndex = -1;
|
|
for (let i = 0; i < navPages.length; i++) {
|
|
if (currentPath.startsWith(navPages[i])) {
|
|
currentIndex = i;
|
|
break;
|
|
}
|
|
}
|
|
|
|
// If not found, disable both
|
|
if (currentIndex === -1) {
|
|
navPrev.disabled = true;
|
|
navNext.disabled = true;
|
|
return;
|
|
}
|
|
|
|
// Set up prev button
|
|
if (currentIndex > 0) {
|
|
navPrev.addEventListener("click", function () {
|
|
window.location.href = navPages[currentIndex - 1];
|
|
});
|
|
} else {
|
|
navPrev.disabled = true;
|
|
}
|
|
|
|
// Set up next button
|
|
if (currentIndex < navPages.length - 1) {
|
|
navNext.addEventListener("click", function () {
|
|
window.location.href = navPages[currentIndex + 1];
|
|
});
|
|
} else {
|
|
navNext.disabled = true;
|
|
}
|
|
});
|