Fitness dashboard v1
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// Fitness dashboard range dropdowns: changing one reloads the page with that
|
||||
// chart's query parameter updated. Plain GET navigation — each range is a
|
||||
// distinct, bookmarkable view, so no postReplace/history handling is needed.
|
||||
document.addEventListener('change', function (e) {
|
||||
var sel = e.target.closest('[data-fitness-range]');
|
||||
if (!sel) return;
|
||||
var url = new URL(window.location.href);
|
||||
url.searchParams.set(sel.dataset.fitnessRange, sel.value);
|
||||
window.location.href = url.toString();
|
||||
});
|
||||
Reference in New Issue
Block a user