From 25ba62e87c8a1a6146b4e2eb903e10e81bcaa65d Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 18 Mar 2020 12:11:15 +0100 Subject: [PATCH] improved ingredient editing --- cookbook/templates/forms/edit_internal_recipe.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cookbook/templates/forms/edit_internal_recipe.html b/cookbook/templates/forms/edit_internal_recipe.html index 35292f2c7..b1333b3c0 100644 --- a/cookbook/templates/forms/edit_internal_recipe.html +++ b/cookbook/templates/forms/edit_internal_recipe.html @@ -182,7 +182,7 @@ }); // load initial value - $('#id_ingredients').val(JSON.stringify(data)) + $('#id_ingredients').val(JSON.stringify(data)); function addIngredientRow() { data.push({ @@ -193,6 +193,9 @@ id: Math.floor(Math.random() * 10000000), delete: false, }); + input = table.rowManager.rows[((table.rowManager.rows).length) - 1].cells[1].getElement() + input.focus(); + input.select(); } document.onkeyup = function (e) {