mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
More initial form field focus optimizations
This commit is contained in:
parent
7d6b76effb
commit
632162c1be
@ -31,11 +31,11 @@ $("#expected_barcode").on("keyup", function(e)
|
||||
}
|
||||
});
|
||||
|
||||
$("#expected_barcode").focus();
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#barcodescanner-start-button").attr("disabled", "");
|
||||
$("#barcodescanner-start-button").addClass("disabled");
|
||||
$("#expected_barcode").focus();
|
||||
}, 500);
|
||||
|
||||
if (GetUriParam("barcode") !== undefined)
|
||||
|
@ -78,11 +78,14 @@ $('.combobox').combobox({
|
||||
});
|
||||
|
||||
$('#battery_id').val('');
|
||||
$('#battery_id_text_input').focus();
|
||||
$('#battery_id_text_input').val('');
|
||||
$('#battery_id_text_input').trigger('change');
|
||||
Grocy.Components.DateTimePicker.GetInputElement().trigger('input');
|
||||
Grocy.FrontendHelpers.ValidateForm('batterytracking-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#battery_id_text_input').focus();
|
||||
}, 500);
|
||||
|
||||
$('#batterytracking-form input').keyup(function(event)
|
||||
{
|
||||
|
@ -111,8 +111,11 @@ for (var i = 0; i < checkboxValues.length; i++)
|
||||
}
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
$('#name').focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('chore-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#name').focus();
|
||||
}, 500);
|
||||
|
||||
if (Grocy.EditMode == "edit")
|
||||
{
|
||||
|
@ -111,10 +111,13 @@ $('.combobox').combobox({
|
||||
clearIfNoMatch: false
|
||||
});
|
||||
|
||||
$('#chore_id_text_input').focus();
|
||||
$('#chore_id_text_input').trigger('change');
|
||||
Grocy.Components.DateTimePicker.GetInputElement().trigger('input');
|
||||
Grocy.FrontendHelpers.ValidateForm('choretracking-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#chore_id_text_input').focus();
|
||||
}, 500);
|
||||
|
||||
$('#choretracking-form input').keyup(function(event)
|
||||
{
|
||||
|
@ -661,7 +661,10 @@ if (GetUriParam("embedded") !== undefined)
|
||||
}
|
||||
|
||||
// Default input field
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 500);
|
||||
|
||||
$(document).on("change", "#scan-mode", function(e)
|
||||
{
|
||||
|
@ -146,8 +146,11 @@ $('#delete-current-instruction-manual-button').on('click', function(e)
|
||||
ResizeResponsiveEmbeds();
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
$('#name').focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('equipment-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#name').focus();
|
||||
}, 500);
|
||||
|
||||
$("#instruction-manual").on("change", function(e)
|
||||
{
|
||||
|
@ -356,24 +356,36 @@ $(".input-group-productamountpicker").trigger("change");
|
||||
Grocy.FrontendHelpers.ValidateForm('inventory-form');
|
||||
|
||||
if (Grocy.Components.ProductPicker.InAnyFlow() === false && GetUriParam("embedded") === undefined)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
|
||||
if (Grocy.Components.ProductPicker.InProductModifyWorkflow())
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
$('#display_amount').on('focus', function(e)
|
||||
{
|
||||
if (Grocy.Components.ProductPicker.GetValue().length === 0)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,4 +1,7 @@
|
||||
$('#username').focus();
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#username').focus();
|
||||
}, 500);
|
||||
|
||||
if (GetUriParam('invalid') === 'true')
|
||||
{
|
||||
|
@ -95,8 +95,11 @@ $("#add-api-key-button").on("click", function(e)
|
||||
});
|
||||
|
||||
$("#add-api-key-modal").on("shown.bs.modal", function(e)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#description").focus();
|
||||
}, 500);
|
||||
});
|
||||
|
||||
$("#new-api-key-button").on("click", function(e)
|
||||
|
@ -77,4 +77,7 @@ $('#mealplansection-form input').keydown(function(event)
|
||||
});
|
||||
|
||||
Grocy.FrontendHelpers.ValidateForm('mealplansection-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#name').focus();
|
||||
}, 500);
|
||||
|
@ -142,7 +142,6 @@ $('.save-product-button').on('click', function(e)
|
||||
if (GetUriParam("flow") == "InplaceNewProductWithName")
|
||||
{
|
||||
$('#name').val(GetUriParam("name"));
|
||||
$('#name').focus();
|
||||
}
|
||||
|
||||
if (GetUriParam("flow") !== undefined || GetUriParam("returnto") !== undefined)
|
||||
@ -258,9 +257,12 @@ barcodeTable.columns.adjust().draw();
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
$("#name").trigger("keyup");
|
||||
$('#name').focus();
|
||||
$('.input-group-qu').trigger('change');
|
||||
Grocy.FrontendHelpers.ValidateForm('product-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#name').focus();
|
||||
}, 500);
|
||||
|
||||
$(document).on('click', '.product-grocycode-label-print', function(e)
|
||||
{
|
||||
|
@ -488,16 +488,22 @@ Grocy.FrontendHelpers.ValidateForm('purchase-form');
|
||||
if (Grocy.Components.ProductPicker)
|
||||
{
|
||||
if (Grocy.Components.ProductPicker.InAnyFlow() === false && GetUriParam("embedded") === undefined)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
|
||||
if (Grocy.Components.ProductPicker.InProductModifyWorkflow())
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -505,8 +511,11 @@ if (Grocy.Components.ProductPicker)
|
||||
$('#display_amount').on('focus', function(e)
|
||||
{
|
||||
if (Grocy.Components.ProductPicker.GetValue().length === 0)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -141,8 +141,11 @@ $('.input-group-qu').on('change', function(e)
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
$('.input-group-qu').trigger('change');
|
||||
$('#from_qu_id').focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('quconversion-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#from_qu_id').focus();
|
||||
}, 500);
|
||||
|
||||
if (GetUriParam("qu-unit") !== undefined)
|
||||
{
|
||||
|
@ -151,8 +151,11 @@ quConversionsTable.columns.adjust().draw();
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
$("#name").trigger("keyup");
|
||||
$('#name').focus();
|
||||
Grocy.FrontendHelpers.ValidateForm('quantityunit-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#name').focus();
|
||||
}, 500);
|
||||
|
||||
$(document).on('click', '.qu-conversion-delete-button', function(e)
|
||||
{
|
||||
|
@ -34,4 +34,7 @@ if (GetUriParam("qu") !== undefined)
|
||||
$("#qu_id").trigger("change");
|
||||
}
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#amount").focus();
|
||||
}, 500);
|
||||
|
@ -106,7 +106,10 @@ $('#recipes-includes-table tbody').removeClass("d-none");
|
||||
recipesIncludesTables.columns.adjust().draw();
|
||||
|
||||
Grocy.FrontendHelpers.ValidateForm('recipe-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#name").focus();
|
||||
}, 500);
|
||||
|
||||
$('#recipe-form input').keyup(function(event)
|
||||
{
|
||||
|
@ -155,8 +155,11 @@ if (Grocy.EditMode == "create")
|
||||
$('#display_amount').on('focus', function(e)
|
||||
{
|
||||
if (Grocy.Components.ProductPicker.GetValue().length === 0)
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ if (!Grocy.Components.ProductPicker.InAnyFlow())
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#display_amount").focus();
|
||||
}, 300);
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -518,7 +518,10 @@ if (GetUriParam("embedded") !== undefined)
|
||||
if (typeof locationId === 'undefined')
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -532,4 +535,7 @@ if (GetUriParam("embedded") !== undefined)
|
||||
}
|
||||
|
||||
// Default input field
|
||||
setTimeout(function()
|
||||
{
|
||||
Grocy.Components.ProductPicker.GetInputElement().focus();
|
||||
}, 500);
|
||||
|
@ -100,11 +100,11 @@ $("#show_in_sidebar_menu").on("click", function()
|
||||
}
|
||||
});
|
||||
|
||||
Grocy.FrontendHelpers.ValidateForm('userentity-form');
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#name').focus();
|
||||
}, 500);
|
||||
Grocy.FrontendHelpers.ValidateForm('userentity-form');
|
||||
|
||||
// Click twice to trigger on-click but not change the actual checked state
|
||||
$("#show_in_sidebar_menu").click();
|
||||
|
@ -121,8 +121,11 @@ if (GetUriParam("entity"))
|
||||
}, 500);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#entity').focus();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
$("#type").trigger("change");
|
||||
|
@ -80,5 +80,8 @@ if (GetUriParam("entity"))
|
||||
{
|
||||
$("#entity-filter").val(GetUriParam("entity"));
|
||||
$("#entity-filter").trigger("change");
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#name").focus();
|
||||
}, 500);
|
||||
}
|
||||
|
@ -154,8 +154,11 @@ if (GetUriParam("changepw") === "true")
|
||||
$("#change_password").click();
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
$('#username').focus();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
|
@ -70,3 +70,8 @@
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
$("#userfields-form").removeClass("border").removeClass("border-info").removeClass("p-2").find("h2").addClass("d-none");
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
$(".userfield-input").first().focus();
|
||||
}, 500);
|
||||
|
Loading…
x
Reference in New Issue
Block a user