diff --git a/app/templates/graphs-combined.php b/app/templates/graphs-combined.php index a279740..e9a0268 100644 --- a/app/templates/graphs-combined.php +++ b/app/templates/graphs-combined.php @@ -2,16 +2,16 @@
- - - - - + + + + + - +
@@ -119,6 +119,18 @@ function setCustomTimeRange() { }); } +// Set the clicked button state to active +function setActive(element) { + // Remove 'active' class from all buttons + var buttons = document.querySelectorAll('.button'); + buttons.forEach(function(btn) { + btn.classList.remove('active'); + }); + + // Add 'active' class only to the clicked button + element.classList.add('active'); +} + // Call setTimeRange('last7days') on page load to pre-load last 7 days by default window.onload = function() { setTimeRange('last7days'); diff --git a/app/templates/page-header.php b/app/templates/page-header.php index dfd24ad..7da371e 100644 --- a/app/templates/page-header.php +++ b/app/templates/page-header.php @@ -37,5 +37,3 @@ - -
diff --git a/app/templates/page-menu.php b/app/templates/page-menu.php index 3c4fd5e..36158ee 100644 --- a/app/templates/page-menu.php +++ b/app/templates/page-menu.php @@ -1,4 +1,6 @@ +
+