refactor: address review feedback — extract date helper, rename listener
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user