Finalize user-defined-fields (closes #176)

This commit is contained in:
Bernd Bestel
2019-04-23 09:06:18 +02:00
parent 72a3f63546
commit c5993ad994
25 changed files with 262 additions and 80 deletions

View File

@@ -14,7 +14,11 @@
Grocy.Api.Post('objects/tasks', jsonData,
function(result)
{
window.location.href = U('/tasks');
Grocy.EditObjectId = result.created_object_id;
Grocy.Components.UserfieldsForm.Save(function()
{
window.location.href = U('/tasks');
});
},
function(xhr)
{
@@ -28,7 +32,10 @@
Grocy.Api.Put('objects/tasks/' + Grocy.EditObjectId, jsonData,
function(result)
{
window.location.href = U('/tasks');
Grocy.Components.UserfieldsForm.Save(function()
{
window.location.href = U('/tasks');
});
},
function(xhr)
{
@@ -61,6 +68,7 @@ $('#task-form input').keydown(function(event)
}
});
Grocy.Components.UserfieldsForm.Load();
$('#name').focus();
Grocy.Components.DateTimePicker.GetInputElement().trigger('input');
Grocy.FrontendHelpers.ValidateForm('task-form');