From 362f8910710146a165abb90fe3a46aa77abd9e8f Mon Sep 17 00:00:00 2001 From: Florian Dagner Date: Tue, 13 Feb 2024 22:26:46 +0100 Subject: [PATCH] refactoring --- js/buchungssatz.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/buchungssatz.js b/js/buchungssatz.js index bb81d63..2c21eb0 100644 --- a/js/buchungssatz.js +++ b/js/buchungssatz.js @@ -36,10 +36,18 @@ function generiereBuchungssatz() { function buchungssatzHerunterladen() { - herunterladen('buchungssatzContainer', 'buchungssatz'); + const emailHTML = document.getElementById('buchungssatzContainer').innerHTML.replace(/ /g, ' ');; + const blob = new Blob([emailHTML], { type: 'html' }); + const a = document.createElement('a'); + a.href = URL.createObjectURL(blob); + a.download = 'buchungssatz.html'; + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); } + function buchungssatzKopiereInZwischenablage() { const buchungssatzHTML = document.getElementById('buchungssatzContainer').innerHTML; navigator.clipboard.writeText(buchungssatzHTML)