Start product picker workflows also by TAB

This commit is contained in:
Bernd Bestel 2020-11-08 22:36:55 +01:00
parent 40283609b5
commit 5f920e2cc6
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,7 @@
- The decimal places for all amount and price inputs can now be configured (stock settings / top right corner settings menu, both default to `4`)
- When clicking the product name on the shopping list, the product card will now be displayed (like on the stock overview page) (thanks @kriddles)
- On the product card there is now also a button to jump directly to the stock entries of the corresponding product (thanks @kriddles)
- The product picker workflows can now also be started by `ENTER` (instead of only `TAB`)
- Fixed that it was not possible to leave the "Barcode(s)" on the product edit page by `TAB`
- Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu)
- Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles)

View File

@ -257,3 +257,17 @@ $(document).on("shown.bs.modal", function(e)
$(".modal-footer").addClass("d-block").addClass("d-sm-flex");
$(".modal-footer").find("button").addClass("mt-2").addClass("mt-sm-0");
})
// Make that ENTER behaves the same like TAB (trigger blur to start workflows, but only when the dropdown is not opened)
$('#product_id_text_input').keydown(function(event)
{
if (event.keyCode === 13) // Enter
{
if (Grocy.Components.ProductPicker.GetPicker().hasClass("combobox-menu-visible"))
{
return;
}
$("#product_id_text_input").trigger("blur");
}
});