mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
Attempt to clear pickers to only allow either product or recipe selection
This commit is contained in:
parent
52698e43b0
commit
222d089872
|
|
@ -215,6 +215,7 @@ $(document).on("click", ".add-recipe-button", function(e)
|
||||||
$("#add-recipe-modal-title").text(__t("Add recipe to %s", day.toString()));
|
$("#add-recipe-modal-title").text(__t("Add recipe to %s", day.toString()));
|
||||||
$("#day").val(day.toString());
|
$("#day").val(day.toString());
|
||||||
Grocy.Components.RecipePicker.Clear();
|
Grocy.Components.RecipePicker.Clear();
|
||||||
|
Grocy.Components.ProductPicker.Clear();
|
||||||
$("#add-recipe-modal").modal("show");
|
$("#add-recipe-modal").modal("show");
|
||||||
Grocy.FrontendHelpers.ValidateForm("add-recipe-form");
|
Grocy.FrontendHelpers.ValidateForm("add-recipe-form");
|
||||||
});
|
});
|
||||||
|
|
@ -538,6 +539,27 @@ $(window).on("resize", function()
|
||||||
calendar.fullCalendar("changeView", "basicWeek");
|
calendar.fullCalendar("changeView", "basicWeek");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||||
|
{
|
||||||
|
var productId = $(e.target).val();
|
||||||
|
|
||||||
|
if (productId)
|
||||||
|
{
|
||||||
|
Grocy.Components.RecipePicker.SetValue('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Grocy.Components.RecipePicker.GetPicker().on('change', function(e)
|
||||||
|
{
|
||||||
|
var recipeId = $(e.target).val();
|
||||||
|
|
||||||
|
if (recipeId)
|
||||||
|
{
|
||||||
|
Grocy.Components.ProductPicker.SetValue('');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function UndoStockTransaction(transactionId)
|
function UndoStockTransaction(transactionId)
|
||||||
{
|
{
|
||||||
Grocy.Api.Post('stock/transactions/' + transactionId.toString() + '/undo', { },
|
Grocy.Api.Post('stock/transactions/' + transactionId.toString() + '/undo', { },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user