First commit

This commit is contained in:
Bernd Bestel
2017-04-15 23:16:20 +02:00
parent d414c8702e
commit b7852d78d0
34 changed files with 1798 additions and 0 deletions

36
views/locationform.js Normal file
View File

@@ -0,0 +1,36 @@
$('#save-location-button').on('click', function(e)
{
e.preventDefault();
if (Grocy.EditMode === 'create')
{
Grocy.PostJson('/api/add-object/locations', $('#location-form').serializeJSON(),
function(result)
{
window.location.href = '/locations';
},
function(xhr)
{
console.error(xhr);
}
);
}
else
{
Grocy.PostJson('/api/edit-object/locations/' + Grocy.EditObjectId, $('#location-form').serializeJSON(),
function(result)
{
window.location.href = '/locations';
},
function(xhr)
{
console.error(xhr);
}
);
}
});
$(function()
{
$('#name').focus();
});