Load all frontend packages conditionally

This commit is contained in:
Bernd Bestel
2023-05-21 10:56:38 +02:00
parent d16d976d0b
commit f427849e89
57 changed files with 580 additions and 487 deletions

View File

@@ -1,17 +1,13 @@
@if (!GROCY_FEATURE_FLAG_DISABLE_BROWSER_BARCODE_CAMERA_SCANNING)
@php require_frontend_packages(['quagga2']); @endphp
@once
@push('componentScripts')
<script src="{{ $U('/viewjs/components/barcodescanner.js', true) }}?v={{ $version }}"></script>
@endpush
@endonce
@once
@push('pageScripts')
<script src="{{ $U('/node_modules/@ericblade/quagga2/dist/quagga.min.js?v=', true) }}{{ $version }}"></script>
@endpush
@endonce
@push('pageStyles')
<style>
#barcodescanner-start-button {
@@ -25,7 +21,6 @@
.combobox-container #barcodescanner-start-button {
margin-right: 36px !important;
}
</style>
@endpush