feat: render sparklines + wire trend-chart pill toggle (#6)
This commit is contained in:
@@ -480,3 +480,20 @@ function closeAddPlayerModal(event) {
|
||||
document.getElementById('add-player-modal').style.display = 'none';
|
||||
pendingPlayerData = null;
|
||||
}
|
||||
|
||||
// ── Sparkline toggle ───────────────────────────────
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var btn = document.getElementById('trendchart-toggle');
|
||||
if (!btn) return;
|
||||
|
||||
var state = localStorage.getItem('ratingtracker.sparklines') || 'on';
|
||||
document.body.dataset.sparklines = state;
|
||||
btn.setAttribute('aria-pressed', state === 'on' ? 'true' : 'false');
|
||||
|
||||
btn.addEventListener('click', function() {
|
||||
var next = document.body.dataset.sparklines === 'on' ? 'off' : 'on';
|
||||
document.body.dataset.sparklines = next;
|
||||
btn.setAttribute('aria-pressed', next === 'on' ? 'true' : 'false');
|
||||
localStorage.setItem('ratingtracker.sparklines', next);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user