Always navigate back to the previous page after saving a product (closes #364)

This commit is contained in:
Bernd Bestel
2019-09-22 09:03:59 +02:00
parent e5530e2058
commit 4c57bf8b9d
3 changed files with 3 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ Grocy.Components.ProductCard.Refresh = function(productId)
$('#productcard-product-stock-opened-amount').text("");
}
$('#productcard-product-edit-button').attr("href", U("/product/" + productDetails.product.id.toString()));
$('#productcard-product-edit-button').attr("href", U("/product/" + productDetails.product.id.toString() + '?' + 'returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative)));
$('#productcard-product-edit-button').removeClass("disabled");
if (productDetails.last_price !== null)