From: Christian Heller Date: Thu, 12 Feb 2026 18:49:04 +0000 (+0100) Subject: Rename "mirror" button to "balance all" and apply it line-by-line. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/static/templates?a=commitdiff_plain;h=9e5b64b9a4e7306ff9e1c9e665cb70d310c90603;p=ledgplom Rename "mirror" button to "balance all" and apply it line-by-line. --- diff --git a/src/templates/edit_structured.html b/src/templates/edit_structured.html index f62b85b..92f14cf 100644 --- a/src/templates/edit_structured.html +++ b/src/templates/edit_structured.html @@ -27,7 +27,7 @@ input.amount { {% block content %} {{ macros.edit_bar(block, 'structured', 'raw') }} - + | diff --git a/src/templates/edit_structured.js b/src/templates/edit_structured.js index 44cbb3d..94459d2 100644 --- a/src/templates/edit_structured.js +++ b/src/templates/edit_structured.js @@ -406,9 +406,13 @@ const replace = () => { }; const mirror = () => { - bookingLines.slice(IDX_PAST_INTRO_LINE).forEach( - (line) => bookingLines.push(balance(line)) - ); + for (let idx = bookingLines.length; idx > IDX_PAST_INTRO_LINE; idx--) { + bookingLines.splice( + idx, + LEN_EMPTY, + balance(bookingLines[idx - LEN_LINE_STEP]) + ); + } taintAndUpdateForm(); };