From 54436256ea40c135b423986672791f9a85202c01 Mon Sep 17 00:00:00 2001
From: lim-kim930 <1625753207lim@gmail.com>
Date: Fri, 15 Apr 2022 16:21:54 +0800
Subject: [PATCH 01/12] fix fullscreen code area bug
---
2.ui-tweaking/4.difference-video-size.html | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/2.ui-tweaking/4.difference-video-size.html b/2.ui-tweaking/4.difference-video-size.html
index cd8c574d..8feb592a 100644
--- a/2.ui-tweaking/4.difference-video-size.html
+++ b/2.ui-tweaking/4.difference-video-size.html
@@ -61,14 +61,18 @@
Enlarge the Video Stream
backToNormal.addEventListener('click', () => {
exitFullPage();
});
- fitPage.addEventListener('click', () => {
+ fitPage.addEventListener('click', async () => {
+ fitPage.hidden = true;
UIElement.classList.add("fullscreen");
+ await updateDisplayArea();
backToNormal.hidden = false;
});
- function exitFullPage() {
- UIElement.classList.remove("fullscreen");
+ async function exitFullPage() {
backToNormal.hidden = true;
+ UIElement.classList.remove("fullscreen");
+ await updateDisplayArea();
+ fitPage.hidden = false;
}
// decode video from camera
async function showScanner() {
@@ -77,7 +81,8 @@ Enlarge the Video Stream
await scanner.setUIElement(document.getElementById('div-ui-container'));
scanner.onUniqueRead = (txt, result) => {
document.getElementById('result').value = result.barcodeFormatString + ": " + txt;
- exitFullPage();
+ if(fitPage.hidden)
+ exitFullPage();
document.getElementById('result').focus();
setTimeout(() => {
document.getElementById('result').blur();
@@ -92,6 +97,12 @@ Enlarge the Video Stream
throw ex;
}
}
+ async function updateDisplayArea() {
+ let scanner = await pScanner;
+ // trigger the resize event to adjust the positioning of the code area
+ const resizeEvent = new Event('resize');
+ window.dispatchEvent(resizeEvent);
+ }
@@ -34,7 +34,7 @@ Click each input box to fill in!
/**
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
- * For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.0&utm_source=github#specify-the-license or contact support@dynamsoft.com.
+ * For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.0.1&utm_source=github#specify-the-license or contact support@dynamsoft.com.
* LICENSE ALERT - THE END
*/
diff --git a/4.use-case/2.read-a-drivers-license.html b/4.use-case/2.read-a-drivers-license.html
index b4661cb9..96e15bb6 100644
--- a/4.use-case/2.read-a-drivers-license.html
+++ b/4.use-case/2.read-a-drivers-license.html
@@ -35,7 +35,7 @@