Fix: Fehlende window.printDiv Funktion ergänzt
All checks were successful
Docker Build & Push / build-and-push (push) Successful in 41s
All checks were successful
Docker Build & Push / build-and-push (push) Successful in 41s
This commit is contained in:
@@ -353,6 +353,28 @@ window.renderAllBarcodes = function() {
|
||||
container.appendChild(col);
|
||||
});
|
||||
}
|
||||
|
||||
window.printDiv = function(divId) {
|
||||
var printContents = document.getElementById(divId).innerHTML;
|
||||
var originalContents = document.body.innerHTML;
|
||||
document.body.innerHTML = `
|
||||
<style>
|
||||
body { font-family: sans-serif; background: none !important; background-color: white !important; }
|
||||
body::before { display: none !important; content: none !important; }
|
||||
.print-grid { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0; }
|
||||
.print-item { text-align: center; margin-bottom: 20px; page-break-inside: avoid; display: inline-block; }
|
||||
p { margin: 0 0 5px 0; font-size: 14px; font-weight: bold; color: black !important; }
|
||||
img { display: inline-block !important; }
|
||||
</style>
|
||||
<div class="print-grid">${printContents}</div>
|
||||
`;
|
||||
|
||||
setTimeout(function() {
|
||||
window.print();
|
||||
document.body.innerHTML = originalContents;
|
||||
window.location.reload();
|
||||
}, 500);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user