mirror of
https://github.com/grocy/grocy.git
synced 2025-08-21 04:43:32 +00:00
Optimized initial focus / workflow handling for recipeposform and shoppinglistitemform
This commit is contained in:
@@ -273,7 +273,7 @@ if (GetUriParam("amount") !== undefined)
|
||||
Grocy.FrontendHelpers.ValidateForm('shoppinglist-form');
|
||||
}
|
||||
|
||||
if (GetUriParam("embedded") !== undefined)
|
||||
if (!Grocy.Components.ProductPicker.InAnyFlow())
|
||||
{
|
||||
if (GetUriParam("product") !== undefined || Grocy.EditMode == "edit")
|
||||
{
|
||||
@@ -282,7 +282,10 @@ if (GetUriParam("embedded") !== undefined)
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
}
|
||||
|
||||
$("#display_amount").focus();
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#display_amount").focus();
|
||||
}, 250);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -292,6 +295,18 @@ if (GetUriParam("embedded") !== undefined)
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
|
||||
if (Grocy.Components.ProductPicker.InProductModifyWorkflow())
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
|
||||
var eitherRequiredFields = $("#product_id,#product_id_text_input,#note");
|
||||
eitherRequiredFields.prop('required', "");
|
||||
|
Reference in New Issue
Block a user