Fixed and optimized some things related to #421 (& some more cleanup)

This commit is contained in:
Bernd Bestel
2020-01-21 17:30:09 +01:00
parent 17e5c04bf9
commit f543a3a472
11 changed files with 213 additions and 429 deletions

View File

@@ -1,23 +1,4 @@
$(document).ready(function() {
if (GetUriParam("embedded") !== undefined)
{
var locationId = GetUriParam('locationId');
if (typeof locationId === 'undefined')
{
Grocy.Components.ProductPicker.GetPicker().trigger('change');
Grocy.Components.ProductPicker.GetInputElement().focus();
} else {
$("#location_id_from").val(locationId);
$("#location_id_from").trigger('change');
$("#use_specific_stock_entry").click();
$("#use_specific_stock_entry").trigger('change');
}
}
});
$('#save-transfer-button').on('click', function(e)
$('#save-transfer-button').on('click', function(e)
{
e.preventDefault();
@@ -440,3 +421,22 @@ function UndoStockTransaction(transactionId)
}
);
};
if (GetUriParam("embedded") !== undefined)
{
var locationId = GetUriParam('locationId');
if (typeof locationId === 'undefined')
{
Grocy.Components.ProductPicker.GetPicker().trigger('change');
Grocy.Components.ProductPicker.GetInputElement().focus();
}
else
{
$("#location_id_from").val(locationId);
$("#location_id_from").trigger('change');
$("#use_specific_stock_entry").click();
$("#use_specific_stock_entry").trigger('change');
}
}