feat(barcode reader): add close btn
This commit is contained in:
@@ -24,10 +24,16 @@ export class BarcodeReader extends HTMLElement {
|
||||
link.rel = 'stylesheet';
|
||||
link.href = '/barcode-reader/barcode-reader.css';
|
||||
this.container.setAttribute('id', 'container');
|
||||
const closeBtn = document.createElement('button');
|
||||
closeBtn.textContent = 'X';
|
||||
closeBtn.onclick = this.stopScan.bind(this);
|
||||
closeBtn.classList.add('close-btn')
|
||||
this.container.appendChild(closeBtn);
|
||||
const videoContainer = document.createElement('div');
|
||||
videoContainer.setAttribute('id', 'video-container');
|
||||
this.container.appendChild(videoContainer);
|
||||
|
||||
|
||||
const overlay = document.createElement('div');
|
||||
overlay.classList.add('overlay');
|
||||
this.video.setAttribute('autoplay', '');
|
||||
|
||||
Reference in New Issue
Block a user