mirror of
https://github.com/grocy/grocy.git
synced 2026-03-28 07:39:25 +01:00
Form productivity improvements
This commit is contained in:
parent
e4b0bbf7f7
commit
7351fce395
|
|
@ -124,6 +124,10 @@ $(function()
|
|||
{
|
||||
$('#product_id_text_input').focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).select();
|
||||
}
|
||||
});
|
||||
|
||||
$('#consume-form input').keydown(function(event)
|
||||
|
|
|
|||
|
|
@ -228,6 +228,10 @@ $(function()
|
|||
{
|
||||
$('#product_id_text_input').focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).select();
|
||||
}
|
||||
});
|
||||
|
||||
$('#inventory-form input').keydown(function(event)
|
||||
|
|
@ -274,6 +278,11 @@ $('#best_before_date-datepicker-button').on('click', function(e)
|
|||
$('.datepicker').datepicker('show');
|
||||
});
|
||||
|
||||
$('#new_amount').on('keypress', function(e)
|
||||
{
|
||||
$('#new_amount').trigger('change');
|
||||
});
|
||||
|
||||
$('#best_before_date').on('change', function(e)
|
||||
{
|
||||
var value = $('#best_before_date').val();
|
||||
|
|
@ -336,6 +345,14 @@ $('#best_before_date').on('keypress', function(e)
|
|||
$('#inventory-form').validator('validate');
|
||||
});
|
||||
|
||||
$('#best_before_date').on('keydown', function(e)
|
||||
{
|
||||
if (e.keyCode === 13) //Enter
|
||||
{
|
||||
$('#best_before_date').trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
$('#new_amount').on('change', function(e)
|
||||
{
|
||||
if ($('#product_id').parent().hasClass('has-error'))
|
||||
|
|
|
|||
|
|
@ -232,6 +232,18 @@ $(function()
|
|||
}
|
||||
});
|
||||
|
||||
$('#amount').on('focus', function(e)
|
||||
{
|
||||
if ($('#product_id_text_input').val().length === 0)
|
||||
{
|
||||
$('#product_id_text_input').focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).select();
|
||||
}
|
||||
});
|
||||
|
||||
$('#purchase-form input').keydown(function(event)
|
||||
{
|
||||
if (event.keyCode === 13) //Enter
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user