Temp: add console.debug to updateTotals for diagnosis

This commit is contained in:
2026-05-20 23:09:14 -04:00
parent 600196f679
commit ec925f9e08
@@ -28,10 +28,13 @@
// Each key must exactly match a property returned by the server's PatchItem action.
function updateTotals(cfg, data) {
const t = cfg.totals || {};
console.debug('[inline-edit] updateTotals data:', data, 'totals cfg:', t);
Object.entries(t).forEach(([key, selector]) => {
const val = data[key];
const els = document.querySelectorAll(selector);
console.debug(`[inline-edit] ${key} → "${selector}": val=${val}, elements=${els.length}`);
if (selector && val !== undefined && val !== null) {
document.querySelectorAll(selector).forEach(el => { el.textContent = fmt(val); });
els.forEach(el => { el.textContent = fmt(val); });
}
});
}