mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 15:01:56 +00:00
Fixed barcode timing issue in print preview
This commit is contained in:
@@ -490,10 +490,16 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="barcodeGrid" class="barcode-grid"></div>
|
<div id="barcodeGrid" class="barcode-grid"></div>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/dist/JsBarcode.all.min.js"><\/script>
|
<script id="jsbarcodeScript" src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.6/dist/JsBarcode.all.min.js"><\/script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`);
|
`);
|
||||||
|
const waitForJsBarcode = new Promise(resolve => {
|
||||||
|
const script = printWindow.document.getElementById("jsbarcodeScript");
|
||||||
|
script.onload = () => resolve();
|
||||||
|
});
|
||||||
|
|
||||||
|
await waitForJsBarcode;
|
||||||
const grid = printWindow.document.getElementById("barcodeGrid");
|
const grid = printWindow.document.getElementById("barcodeGrid");
|
||||||
|
|
||||||
for (let i = 0; i < batch.length; i++) {
|
for (let i = 0; i < batch.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user