refactor: address review feedback — extract date helper, rename listener

This commit is contained in:
Samuel Enocsson
2026-05-22 11:47:47 +02:00
parent a63da6f3ca
commit fba1bea247
4 changed files with 15 additions and 15 deletions
+2 -3
View File
@@ -40,15 +40,14 @@ function initChartsIn(rootEl) {
});
}
function setupTooltipsAfterSwap() {
function setupAfterTableSwap() {
document.body.addEventListener('htmx:afterSwap', function(event) {
const target = event.detail.target;
if (target.id === 'ratings-table') {
initRatingsTooltips();
initChartsIn(target); // initial table render — chart any pre-loaded .player-chart
initChartsIn(target);
return;
}
// refreshRatingHistory still re-fetches into #history-content-<id>
if (target.id && target.id.startsWith('history-content-')) {
initChartsIn(target);
}