add hover tooltip to rent expenses column

This commit is contained in:
Johannes
2026-03-20 02:21:49 +01:00
parent 1b7029681e
commit 8e452f484c
2 changed files with 12 additions and 0 deletions

6
ui.js
View File

@@ -214,6 +214,12 @@ const build_table = (result) => {
const td_rent_cost = document.createElement('td');
td_rent_cost.textContent = fmt_eur(result.cum_rent_arr[i]);
td_rent_cost.classList.add('has-tip');
td_rent_cost.addEventListener('mouseenter', (e) => show_tooltip(e, [
`<span style="color:#8b949e;font-size:0.72rem;text-transform:uppercase;letter-spacing:.05em">dieses Jahr</span>`,
tip_row('Kaltmiete', d.yr_rent, '#2dd4bf'),
tip_row('Versicherung', d.yr_renters_ins, '#2dd4bf'),
].join('<br>')));
tr.appendChild(document.createElement('td')).textContent = result.labels[i];
tr.appendChild(td_buy_nw);