mirror of
https://github.com/grocy/grocy.git
synced 2026-04-08 21:46:16 +02:00
Allow replacing a product picture when removing it at first
Right now, a preview image of a product doesn't get updated when pressing the delete-button at first and adding a new image the upload-form which can be quite confusing for an end-user. This patch allows to delete an image and add a new one in one go.
This commit is contained in:
parent
2b0208e88c
commit
007b427f1f
|
|
@ -342,6 +342,12 @@ $("#allow_partial_units_in_stock").on("click", function()
|
||||||
Grocy.FrontendHelpers.ValidateForm("product-form");
|
Grocy.FrontendHelpers.ValidateForm("product-form");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#product-picture').change(function () {
|
||||||
|
if ($(this).val()) {
|
||||||
|
Grocy.DeleteProductPictureOnSave = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Grocy.DeleteProductPictureOnSave = false;
|
Grocy.DeleteProductPictureOnSave = false;
|
||||||
$('#delete-current-product-picture-button').on('click', function(e)
|
$('#delete-current-product-picture-button').on('click', function(e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user