changed logic for kiosk mode to take print out in sticker validation
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 15s
Laravel Larastan / larastan (pull_request) Failing after 2m17s
Laravel Pint / pint (pull_request) Failing after 2m19s

This commit is contained in:
dhanabalan
2025-12-30 16:36:26 +05:30
parent 46649d0459
commit 39b5cf77e4

View File

@@ -37,7 +37,7 @@ document.addEventListener('livewire:init', () => {
});
</script> --}}
<script>
{{-- <script>
document.addEventListener('DOMContentLoaded', () => {
window.addEventListener('open-stickers-sequence', (event) => {
console.log('EVENT RECEIVED');
@@ -47,5 +47,23 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
});
</script> --}}
<script>
window.addEventListener('open-stickers-sequence', async (event) => {
const urls = event.detail.urls;
for (const url of urls) {
const win = window.open(url, '_blank');
win.onload = () => {
win.focus();
win.print();
};
// wait before next
await new Promise(r => setTimeout(r, 1500));
}
});
</script>