Improved product picture display on the productcard

This commit is contained in:
Bernd Bestel
2019-09-20 20:10:03 +02:00
parent c228126c3a
commit 653098a81e
2 changed files with 1 additions and 5 deletions

View File

@@ -80,13 +80,11 @@ Grocy.Components.ProductCard.Refresh = function(productId)
if (productDetails.product.picture_file_name !== null && !productDetails.product.picture_file_name.isEmpty())
{
$("#productcard-no-product-picture").addClass("d-none");
$("#productcard-product-picture").removeClass("d-none");
$("#productcard-product-picture").attr("src", U('/api/files/productpictures/' + btoa(productDetails.product.picture_file_name) + '?force_serve_as=picture&best_fit_width=400'));
}
else
{
$("#productcard-no-product-picture").removeClass("d-none");
$("#productcard-product-picture").addClass("d-none");
}