Various JS optimizations

This commit is contained in:
Bernd Bestel
2023-05-21 18:01:47 +02:00
parent 825321593b
commit 979c67b44c
25 changed files with 64 additions and 87 deletions

View File

@@ -79,9 +79,12 @@
@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING)<strong>{{ $__t('Average shelf life') }}:</strong> <span id="productcard-product-average-shelf-life"></span><br>@endif
<strong>{{ $__t('Spoil rate') }}:</strong> <span id="productcard-product-spoil-rate"></span>
<p class="w-75 mt-3 mx-auto"><img id="productcard-product-picture"
data-src=""
class="img-fluid img-thumbnail d-none lazy"></p>
<p class="w-75 mt-3 mx-auto">
<img id="productcard-product-picture"
class="img-fluid img-thumbnail d-none"
src=""
loading="lazy">
</p>
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
<h5 class="mt-3">{{ $__t('Price history') }}</h5>

View File

@@ -44,9 +44,9 @@ $excludeFieldTypes = [];
<a class="show-as-dialog-link"
href="{{ $U('/files/userfiles/'. $userfieldObject->value . '?force_serve_as=picture') }}">
<img src="{{ $U('/files/userfiles/'. $userfieldObject->value . '?force_serve_as=picture&best_fit_width=32&best_fit_height=32') }}"
class="lazy"
title="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}"
alt="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}">
alt="{{ base64_decode(explode('_', $userfieldObject->value)[1]) }}"
loading="lazy">
</a>
@else
{{ $userfieldObject->value }}

View File

@@ -203,8 +203,8 @@
</div>
<img src=""
alt="{{ $userfield->name }}"
class="userfield-current-file userfield-file-show d-none lazy mt-1 discrete-link"
data-uf-name="{{ $userfield->name }}" />
class="userfield-current-file userfield-file-show d-none mt-1 discrete-link"
loading="lazy" />
</div>
@endif