Optimized GROCY_FEATURE_FLAG_STOCK handling (closes #966)

This commit is contained in:
Bernd Bestel
2020-12-21 20:13:49 +01:00
parent 7478d9bb38
commit 694b78f72a
11 changed files with 90 additions and 99 deletions

View File

@@ -126,6 +126,12 @@ var calendar = $("#calendar").fullCalendar({
costsAndCaloriesPerServing = '<h5 class="small text-truncate"><span class="locale-number locale-number-generic">' + resolvedRecipe.calories + '</span> kcal ' + __t('per serving') + '<h5>';
}
if (!Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK)
{
fulfillmentIconHtml = "";
fulfillmentInfoHtml = "";
}
element.html('\
<div> \
<h5 class="text-truncate">' + recipe.name + '<h5> \
@@ -274,6 +280,12 @@ var calendar = $("#calendar").fullCalendar({
{
$("#calendar").fullCalendar("gotoDate", GetUriParam("week"));
}
if (!Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK)
{
$(".recipe-order-missing-button").addClass("d-none");
$(".recipe-consume-button").addClass("d-none");
}
},
});

View File

@@ -546,7 +546,7 @@ $("img.barcode").each(function()
img.attr("src", dummyCanvas.toDataURL("image/png"));
});
if ($(window).width() < 768)
if ($(window).width() < 768 || !Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK)
{
$("#filter-container").removeClass("border-bottom");
}

View File

@@ -145,8 +145,6 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
if (productId)
{
Grocy.Components.ProductCard.Refresh(productId);
Grocy.Api.Get('stock/products/' + productId,
function(productDetails)
{