improved ingredient editing

This commit is contained in:
vabene1111
2020-03-18 12:11:15 +01:00
parent 48107b918d
commit 25ba62e87c

View File

@@ -182,7 +182,7 @@
}); });
// load initial value // load initial value
$('#id_ingredients').val(JSON.stringify(data)) $('#id_ingredients').val(JSON.stringify(data));
function addIngredientRow() { function addIngredientRow() {
data.push({ data.push({
@@ -193,6 +193,9 @@
id: Math.floor(Math.random() * 10000000), id: Math.floor(Math.random() * 10000000),
delete: false, delete: false,
}); });
input = table.rowManager.rows[((table.rowManager.rows).length) - 1].cells[1].getElement()
input.focus();
input.select();
} }
document.onkeyup = function (e) { document.onkeyup = function (e) {