mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 20:26:42 +00:00
Form productivity improvements
This commit is contained in:
@@ -124,6 +124,10 @@ $(function()
|
|||||||
{
|
{
|
||||||
$('#product_id_text_input').focus();
|
$('#product_id_text_input').focus();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$(this).select();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#consume-form input').keydown(function(event)
|
$('#consume-form input').keydown(function(event)
|
||||||
|
@@ -228,6 +228,10 @@ $(function()
|
|||||||
{
|
{
|
||||||
$('#product_id_text_input').focus();
|
$('#product_id_text_input').focus();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$(this).select();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#inventory-form input').keydown(function(event)
|
$('#inventory-form input').keydown(function(event)
|
||||||
@@ -274,6 +278,11 @@ $('#best_before_date-datepicker-button').on('click', function(e)
|
|||||||
$('.datepicker').datepicker('show');
|
$('.datepicker').datepicker('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#new_amount').on('keypress', function(e)
|
||||||
|
{
|
||||||
|
$('#new_amount').trigger('change');
|
||||||
|
});
|
||||||
|
|
||||||
$('#best_before_date').on('change', function(e)
|
$('#best_before_date').on('change', function(e)
|
||||||
{
|
{
|
||||||
var value = $('#best_before_date').val();
|
var value = $('#best_before_date').val();
|
||||||
@@ -336,6 +345,14 @@ $('#best_before_date').on('keypress', function(e)
|
|||||||
$('#inventory-form').validator('validate');
|
$('#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)
|
$('#new_amount').on('change', function(e)
|
||||||
{
|
{
|
||||||
if ($('#product_id').parent().hasClass('has-error'))
|
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)
|
$('#purchase-form input').keydown(function(event)
|
||||||
{
|
{
|
||||||
if (event.keyCode === 13) //Enter
|
if (event.keyCode === 13) //Enter
|
||||||
|
Reference in New Issue
Block a user