#454 Refactor printQRCode

This commit is contained in:
Daniel Brendel
2025-09-25 12:02:20 +02:00
parent 5bf31fe1be
commit a3edae8d9c
2 changed files with 11 additions and 7 deletions

View File

@@ -1493,14 +1493,18 @@ window.createVueInstance = function(element) {
},
printQRCode: function(content, title) {
let wnd = window.open('', title, 'height=auto, width=auto');
const html = '<html><head><title>' + title + '</title></head><body><img src="' + content + '"/></body></html>';
wnd.document.write('<html><head><title>' + title + '</title></head><body>');
wnd.document.write('<img src="' + content + '"/>');
wnd.document.write('</body></html>');
const blob = new Blob([html], { type: 'text/html' });
const url = URL.createObjectURL(blob);
wnd.print();
wnd.close();
let wnd = window.open(url, title, 'height=auto, width=auto');
wnd.onload = function() {
wnd.print();
wnd.close();
URL.revokeObjectURL(url);
};
},
bulkChecked: function(target, flag) {

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long