Skip to content

Commit b05ef6f

Browse files
committed
payment: add classes to check for
dont depend on german language Change-Id: I77f07d5e93760ad400bc6043325b76cafd297943
1 parent 302f20f commit b05ef6f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

assets/js/payment_poll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
return;
4646
}
4747

48-
if (overlay.innerHTML.includes('QR') || overlay.innerHTML.includes('bezahlen')) {
48+
if (overlay.classList.contains('overlay-qr') || overlay.classList.contains('overlay-both')) {
4949
startPolling();
5050
}
5151
});

assets/js/tools.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,12 @@ const photoboothTools = (function () {
671671
const qrUrl =
672672
'https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=' +
673673
encodeURIComponent(data.payment_url);
674+
const statusClass = {
675+
both: 'overlay-both',
676+
qr: 'overlay-qr'
677+
}[data.status];
678+
const overlay = document.querySelector('.overlay');
679+
674680
api.overlay.show(`
675681
<div style="text-align:center;">
676682
<div style="font-size:1.4em; margin-bottom:12px;">${paymentMessage}</div>
@@ -680,6 +686,8 @@ const photoboothTools = (function () {
680686
</div>
681687
`);
682688
api.isPrinting = false;
689+
overlay.classList.remove('overlay-both', 'overlay-qr');
690+
overlay.classList.add(statusClass);
683691
} else {
684692
api.overlay.showError(data.error || api.getTranslation('payments_failed'));
685693
api.resetPrintErrorMessage(cb, notificationTimeout);

0 commit comments

Comments
 (0)