mirror of
https://github.com/grocy/grocy.git
synced 2025-08-17 11:06:36 +00:00
Added a new product option "Disable own stock" (closes #564)
This commit is contained in:
@@ -110,7 +110,16 @@ Grocy.Components.ProductCard.Refresh = function(productId)
|
||||
$("#productcard-product-picture").addClass("d-none");
|
||||
}
|
||||
|
||||
$("#productcard-product-stock-amount-wrapper").removeClass("d-none");
|
||||
$("#productcard-aggregated-amounts").addClass("pl-2");
|
||||
if (productDetails.product.no_own_stock == 1)
|
||||
{
|
||||
$("#productcard-product-stock-amount-wrapper").addClass("d-none");
|
||||
$("#productcard-aggregated-amounts").removeClass("pl-2");
|
||||
}
|
||||
|
||||
RefreshContextualTimeago(".productcard");
|
||||
RefreshLocaleNumberDisplay(".productcard");
|
||||
},
|
||||
function(xhr)
|
||||
{
|
||||
|
@@ -122,11 +122,19 @@ if (!prefillProductId2.isEmpty())
|
||||
if (typeof prefillProductId !== "undefined")
|
||||
{
|
||||
$('#product_id').val(prefillProductId);
|
||||
$('#product_id').data('combobox').refresh();
|
||||
$('#product_id').trigger('change');
|
||||
|
||||
var nextInputElement = $(Grocy.Components.ProductPicker.GetPicker().parent().data('next-input-selector').toString());
|
||||
nextInputElement.focus();
|
||||
if ($('#product_id').val() != null)
|
||||
{
|
||||
$('#product_id').data('combobox').refresh();
|
||||
$('#product_id').trigger('change');
|
||||
|
||||
var nextInputElement = $(Grocy.Components.ProductPicker.GetPicker().parent().data('next-input-selector').toString());
|
||||
nextInputElement.focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}
|
||||
}
|
||||
|
||||
if (GetUriParam("flow") === "InplaceAddBarcodeToExistingProduct")
|
||||
|
Reference in New Issue
Block a user