From 2e625f330d7d1fadc1e96a628021c92bb3fc8203 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 13 Apr 2020 22:30:35 +0200 Subject: [PATCH] Little style changes and changelog for #733 --- changelog/58_UNRELEASED_2020-xx-xx.md | 10 ++++++---- public/viewjs/components/barcodescanner.js | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/changelog/58_UNRELEASED_2020-xx-xx.md b/changelog/58_UNRELEASED_2020-xx-xx.md index 4a0ce2a9..385e5a87 100644 --- a/changelog/58_UNRELEASED_2020-xx-xx.md +++ b/changelog/58_UNRELEASED_2020-xx-xx.md @@ -46,12 +46,14 @@ ### General & other improvements/fixes - Optimized that sometimes the corresponding form was not validated when selecting a date from the datetimepicker - New `config.php` setting `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_FIELD_NUMBER_PAD` which activates the number pad for best-before-date fields on (supported) mobile browsers (useful because of [shorthands](https://github.com/grocy/grocy#input-shorthands-for-date-fields)) (defaults to `true`) (thanks @Mik-) -- Enhancements for the camera barcode scanner (thanks @Mik- for the work on improving the torch capabilities & CSS) +- Enhancements for the camera barcode scanner + - Torch / light improvements (thanks @Mik-) + - The light button only displayed when the device has a flash light + - New `config.php` setting `FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA` to always enable the flash light automatically + - It's now possible to change the camera when the device has more than one (dropdown in the camera scanning dialog, only visible if there is more than one camera available) (thanks @MichaelMadsen) - Replaced [QuaggaJS](https://github.com/serratus/quaggaJS) (seems to be unmaintained) by [Quagga2](https://github.com/ericblade/quagga2) - - The light button only displayed when the device has a flash light - - New `config.php` setting `FEATURE_FLAG_AUTO_TORCH_ON_WITH_CAMERA` to always enable the flash light automatically - New user setting `quagga2_numofworkers` (`config.php`) to make the Quagga2 setting "numOfWorkers" adjustable (defaults to `4`) - - Various display/CSS improvements + - Various display/CSS improvements (thanks @Mik-) - Prerequisites (PHP extensions, critical files/folders) will now be checked and properly reported if there are problems (thanks @Forceu) - Improved the the overview pages on mobile devices (main column was hidden) (thanks @Mik-) - The general search field now searches accent insensitive diff --git a/public/viewjs/components/barcodescanner.js b/public/viewjs/components/barcodescanner.js index b8bbb618..ef313e0a 100644 --- a/public/viewjs/components/barcodescanner.js +++ b/public/viewjs/components/barcodescanner.js @@ -10,7 +10,7 @@ Grocy.Components.BarcodeScanner.CheckCapabilities = async function() // If there is more than 1 camera, show the camera selection var cameras = await Quagga.CameraAccess.enumerateVideoDevices(); - var cameraSelect = document.querySelector('.cameraSelect'); + var cameraSelect = document.querySelector('.cameraSelect-wrapper'); if (cameraSelect) { cameraSelect.style.display = cameras.length > 1 ? 'inline-block' : 'none'; } @@ -238,7 +238,7 @@ $(document).on("click", "#barcodescanner-start-button", async function(e) }); // Add camera select to existing dialog - dialog.find('.bootbox-body').append(''); + dialog.find('.bootbox-body').append('
'); var cameraSelect = document.querySelector('.cameraSelect'); var cameras = await Quagga.CameraAccess.enumerateVideoDevices();